G
GS
please bear with me, I already tried the built-in help, Google but not
finding the solution.
I want to use generic KeyedCollection
first crack
private class RegexHolder
{
String Name;
bool Tested;
RegexOptions regexOption;
String Regex;
String rRemark;
String Groups;
String Category;
String sybRegexList;
protected RegexHolder(String strRegexName, bool bTested,
RegexOptions iRegexOption, String strRegex,
String comment, String strGroups)
{
RegexName = strRegexName;
Tested = bTested;
regexOption = iRegexOption;
Regex = strRegex;
rRemark = comment;
Groups = strGroups;
}
protected int iTested {
get { return (int)Tested; }
}
protected int iRegex
{
get { return (int) regexOption; }
}
};
KeyedCollection<String, RegexHolder> myRegexCollection;
.......
myRegexCollection = new KeyedCollection<String, RegexHolder>
();
and I got complier err about abstract class on the last statement above
So I tried
private class RegexHolder
{
String Name;
/* .... so on like last time around
};
private class myRegexCollection : KeyedCollection<String,
RegexHolder>
{
protected myRegexCollection()
{
KeyedCollection<String, RegexHolder>();
}
protected string GetKeyForItem() {
return item.Name;
}
}
But then I stll get
Error 1 'RegexParse.RegexParse2Csv.myRegexCollection' does not implement
inherited abstract member
'System.Collections.ObjectModel.KeyedCollection<string,RegexParse.RegexParse
2Csv.RegexHolder>.GetKeyForItem(RegexParse.RegexParse2Csv.RegexHolder)'
D:\data\IeI\gp\AppCom\IeStringClassProd\RegexParse2CSV\RegexParse2CSV\RegexP
arse2Csv.cs 62 23 RegexParse2CSV
what did do wrong with GetKeyForItem?
finding the solution.
I want to use generic KeyedCollection
first crack
private class RegexHolder
{
String Name;
bool Tested;
RegexOptions regexOption;
String Regex;
String rRemark;
String Groups;
String Category;
String sybRegexList;
protected RegexHolder(String strRegexName, bool bTested,
RegexOptions iRegexOption, String strRegex,
String comment, String strGroups)
{
RegexName = strRegexName;
Tested = bTested;
regexOption = iRegexOption;
Regex = strRegex;
rRemark = comment;
Groups = strGroups;
}
protected int iTested {
get { return (int)Tested; }
}
protected int iRegex
{
get { return (int) regexOption; }
}
};
KeyedCollection<String, RegexHolder> myRegexCollection;
.......
myRegexCollection = new KeyedCollection<String, RegexHolder>
();
and I got complier err about abstract class on the last statement above
So I tried
private class RegexHolder
{
String Name;
/* .... so on like last time around
};
private class myRegexCollection : KeyedCollection<String,
RegexHolder>
{
protected myRegexCollection()
{
KeyedCollection<String, RegexHolder>();
}
protected string GetKeyForItem() {
return item.Name;
}
}
But then I stll get
Error 1 'RegexParse.RegexParse2Csv.myRegexCollection' does not implement
inherited abstract member
'System.Collections.ObjectModel.KeyedCollection<string,RegexParse.RegexParse
2Csv.RegexHolder>.GetKeyForItem(RegexParse.RegexParse2Csv.RegexHolder)'
D:\data\IeI\gp\AppCom\IeStringClassProd\RegexParse2CSV\RegexParse2CSV\RegexP
arse2Csv.cs 62 23 RegexParse2CSV
what did do wrong with GetKeyForItem?