G
Guest
I have a class called StoredProcedureInfo that has four get/set
properties: ID, Name, Text and IsChecked. I have created a generic
list of this class, populated it and now want to make sure certain
values exist in it.
===================================
protected List<StoredProcedureInfo> storedProcedureList = new
List<StoredProcedureInfo>();
===================================
In a simpler generic list -- for example, List<int> -- I would do this
by calling List<int>.Contains() or List<int>.IndexOf() . But how would
I do this in a more complex, custom class like mine? I'm attaching my
class declaration code below, in case it helps... any help or advince
would be appreciated!
===================================
public class StoredProcedureInfo {
private int databaseObjectId = 0;
private string storedProcedureName = null;
private string storedProcedureCreateStatement = null;
private bool isChecked = false;
// Constructors
public StoredProcedureInfo(int DatabaseObjectId, string
StoredProcedureName, string CreateProcedureText, bool IsChecked) {
this.StoredProcedureID = DatabaseObjectId;
this.StoredProcedureName = StoredProcedureName;
this.StoredProcedureText = CreateProcedureText;
this.IsStoredProcedureChecked = IsChecked;
}
public StoredProcedureInfo(int DatabaseObjectId, string
StoredProcedureName, string CreateProcedureText) :
this(DatabaseObjectId, StoredProcedureName, CreateProcedureText, false)
{ }
public StoredProcedureInfo() { }
// Properties
public int StoredProcedureID {
get { return databaseObjectId; }
private set { databaseObjectId = value; }
}
public string StoredProcedureName {
get { return storedProcedureName; }
private set { storedProcedureName = value; }
}
public string StoredProcedureText {
get { return storedProcedureCreateStatement; }
private set { storedProcedureCreateStatement = value; }
}
public bool IsStoredProcedureChecked {
get { return isChecked; }
private set { isChecked = value; }
}
}
===================================
-= Tek Boy =-
properties: ID, Name, Text and IsChecked. I have created a generic
list of this class, populated it and now want to make sure certain
values exist in it.
===================================
protected List<StoredProcedureInfo> storedProcedureList = new
List<StoredProcedureInfo>();
===================================
In a simpler generic list -- for example, List<int> -- I would do this
by calling List<int>.Contains() or List<int>.IndexOf() . But how would
I do this in a more complex, custom class like mine? I'm attaching my
class declaration code below, in case it helps... any help or advince
would be appreciated!
===================================
public class StoredProcedureInfo {
private int databaseObjectId = 0;
private string storedProcedureName = null;
private string storedProcedureCreateStatement = null;
private bool isChecked = false;
// Constructors
public StoredProcedureInfo(int DatabaseObjectId, string
StoredProcedureName, string CreateProcedureText, bool IsChecked) {
this.StoredProcedureID = DatabaseObjectId;
this.StoredProcedureName = StoredProcedureName;
this.StoredProcedureText = CreateProcedureText;
this.IsStoredProcedureChecked = IsChecked;
}
public StoredProcedureInfo(int DatabaseObjectId, string
StoredProcedureName, string CreateProcedureText) :
this(DatabaseObjectId, StoredProcedureName, CreateProcedureText, false)
{ }
public StoredProcedureInfo() { }
// Properties
public int StoredProcedureID {
get { return databaseObjectId; }
private set { databaseObjectId = value; }
}
public string StoredProcedureName {
get { return storedProcedureName; }
private set { storedProcedureName = value; }
}
public string StoredProcedureText {
get { return storedProcedureCreateStatement; }
private set { storedProcedureCreateStatement = value; }
}
public bool IsStoredProcedureChecked {
get { return isChecked; }
private set { isChecked = value; }
}
}
===================================
-= Tek Boy =-