Completata separazione huge file
This commit is contained in:
@@ -0,0 +1,126 @@
|
||||
namespace WebWindowComplex.Models
|
||||
{
|
||||
public struct IdNameStruct
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public IdNameStruct(int Id, string Name)
|
||||
{
|
||||
this = default(IdNameStruct);
|
||||
m_Id = Id;
|
||||
m_Name = Name;
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Properties
|
||||
|
||||
public int Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Id;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Id = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Name;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Name = value;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public static int IdFromInd(int Ind, List<IdNameStruct> List)
|
||||
{
|
||||
return List[Ind].Id;
|
||||
}
|
||||
|
||||
public static int IdFromInd(int Ind, List<object> List)
|
||||
{
|
||||
if (List[Ind] is IdNameStruct)
|
||||
{
|
||||
return ((IdNameStruct)List[Ind]).Id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static int IdFromName(string Name, List<object> List)
|
||||
{
|
||||
checked
|
||||
{
|
||||
int num = List.Count - 1;
|
||||
for (int i = 0; i <= num; i++)
|
||||
{
|
||||
if (string.Compare(((IdNameStruct)List[i]).Name, Name, false) == 0)
|
||||
{
|
||||
return ((IdNameStruct)List[i]).Id;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static int IndFromId(int Id, List<IdNameStruct> List)
|
||||
{
|
||||
checked
|
||||
{
|
||||
int num = List.Count - 1;
|
||||
for (int i = 0; i <= num; i++)
|
||||
{
|
||||
if (List[i].Id == Id)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static int IndFromId(int Id, List<object> List)
|
||||
{
|
||||
checked
|
||||
{
|
||||
int num = List.Count - 1;
|
||||
for (int i = 0; i <= num; i++)
|
||||
{
|
||||
if (List[i] is IdNameStruct && ((IdNameStruct)List[i]).Id == Id)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private int m_Id;
|
||||
|
||||
private string m_Name;
|
||||
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user