B
Bob Roy
Could someone help me translating the following C# code to VB? Is there
a different newsgroup where it would be better to post this?
[ListBindable(false)]
public class CategoriesInfo : CollectionBase {
static CategoriesInfo instance;
// create the static instance of the class
static CategoriesInfo() {
instance = new CategoriesInfo();
}
public CategoryInfo this[int index] { get { return List[index] as
CategoryInfo; } }
public CategoryInfo this[string name] {
get {
for(int i = 0; i < Count; i ++)
if(name.ToUpper() == this.Name.ToUpper())
return this;
return null;
}
}
// Register the category in the system
public static void Add(string name, int imageIndex) {
CategoryInfo item = new CategoryInfo(name, imageIndex);
instance.List.Add(item);
}
public static void Add(string name) {
CategoriesInfo.Add(name, -1);
}
public static CategoriesInfo Instance { get { return instance; } }
}
a different newsgroup where it would be better to post this?
[ListBindable(false)]
public class CategoriesInfo : CollectionBase {
static CategoriesInfo instance;
// create the static instance of the class
static CategoriesInfo() {
instance = new CategoriesInfo();
}
public CategoryInfo this[int index] { get { return List[index] as
CategoryInfo; } }
public CategoryInfo this[string name] {
get {
for(int i = 0; i < Count; i ++)
if(name.ToUpper() == this.Name.ToUpper())
return this;
return null;
}
}
// Register the category in the system
public static void Add(string name, int imageIndex) {
CategoryInfo item = new CategoryInfo(name, imageIndex);
instance.List.Add(item);
}
public static void Add(string name) {
CategoriesInfo.Add(name, -1);
}
public static CategoriesInfo Instance { get { return instance; } }
}