Added comments & commented out unused dictionary
This commit is contained in:
parent
9098c58ea8
commit
bb81c62e3e
@ -45,6 +45,7 @@ namespace VEPROMS.CSLA.Library
|
||||
public int ParentID;
|
||||
public rochild[] children;
|
||||
};
|
||||
// rogrp defines tree structure
|
||||
public struct rogrp
|
||||
{
|
||||
public int ID;
|
||||
@ -53,19 +54,27 @@ namespace VEPROMS.CSLA.Library
|
||||
public string value;
|
||||
public string appid;
|
||||
};
|
||||
// rochild can be read directory from the ro.fst. Read in from ro.fst as bytes.
|
||||
public struct rochild
|
||||
{
|
||||
public int ID;
|
||||
public int ParentID;
|
||||
public int type;
|
||||
public string title;
|
||||
public string roid;
|
||||
public string appid;
|
||||
public string value;
|
||||
public string title; // gets used for treeview
|
||||
public string roid; // roid unique identifier
|
||||
public string appid; // accessory page id - user specified unique id
|
||||
public string value; // return value, can be multiple values
|
||||
public rochild[] children;
|
||||
};
|
||||
// roChild is a container for rochild
|
||||
public class roChild
|
||||
{
|
||||
//private static int _roChildUnique = 0;
|
||||
//private static int roChildUnique
|
||||
//{ get { return ++_roChildUnique; } }
|
||||
//private int _MyRoChildUnique = roChildUnique;
|
||||
//public int MyRoChildUnique // Absolutely Unique ID - Info
|
||||
//{ get { return _MyRoChildUnique; } }
|
||||
rochild _MyChild;
|
||||
public rochild MyChild
|
||||
{
|
||||
@ -86,7 +95,7 @@ namespace VEPROMS.CSLA.Library
|
||||
private string _ROValue = "";
|
||||
private List<string> lstRoValues;
|
||||
private List<string> multiRoValues;
|
||||
private Dictionary<string, string> DictROVar = new Dictionary<string, string>();
|
||||
private Dictionary<string, string> DictROVar = new Dictionary<string, string>(); //use this to find values within return value
|
||||
#endregion
|
||||
#region Constructors
|
||||
private ROFst _ROFst;
|
||||
@ -162,12 +171,12 @@ namespace VEPROMS.CSLA.Library
|
||||
public roHdr myHdr;
|
||||
private int TableID;
|
||||
private Dictionary<string, rochild> dicRos;
|
||||
private Dictionary<int, rochild> dicRosIntIDs;
|
||||
// private Dictionary<int, rochild> dicRosIntIDs; - not used
|
||||
private Dictionary<string, string> dicRoDBs;
|
||||
public void Reset()
|
||||
{
|
||||
dicRos = null;
|
||||
dicRosIntIDs = null;
|
||||
//dicRosIntIDs = null;
|
||||
dicRoDBs = null;
|
||||
}
|
||||
#endregion
|
||||
@ -175,29 +184,29 @@ namespace VEPROMS.CSLA.Library
|
||||
public void Close()
|
||||
{
|
||||
// remove the dictionary
|
||||
if (dicRosIntIDs != null)dicRosIntIDs.Clear();
|
||||
dicRosIntIDs = null;
|
||||
//if (dicRosIntIDs != null)dicRosIntIDs.Clear();
|
||||
//dicRosIntIDs = null;
|
||||
if (dicRos != null)dicRos.Clear();
|
||||
dicRos = null;
|
||||
if (dicRoDBs != null) dicRoDBs.Clear();
|
||||
dicRoDBs = null;
|
||||
}
|
||||
private Dictionary<string, string> _dicROAPIDLookup;
|
||||
public string GetAccPageID(string roid)
|
||||
{
|
||||
if(_dicROAPIDLookup==null)
|
||||
{
|
||||
_dicROAPIDLookup = new Dictionary<string,string>();
|
||||
if (_dicROAPID == null)
|
||||
BuildROAPIDDictionary();
|
||||
foreach (string appid in _dicROAPID.Keys)
|
||||
_dicROAPIDLookup.Add(_dicROAPID[appid].roid,appid);
|
||||
}
|
||||
String roidkey = roid.Substring(0, 12).ToUpper();
|
||||
if(_dicROAPIDLookup.ContainsKey(roidkey))
|
||||
return _dicROAPIDLookup[roidkey];
|
||||
return null;
|
||||
}
|
||||
//private Dictionary<string, string> _dicROAPIDLookup;
|
||||
//public string GetAccPageID(string roid)
|
||||
//{
|
||||
// if(_dicROAPIDLookup==null)
|
||||
// {
|
||||
// _dicROAPIDLookup = new Dictionary<string,string>();
|
||||
// if (_dicROAPID == null)
|
||||
// BuildROAPIDDictionary();
|
||||
// foreach (string appid in _dicROAPID.Keys)
|
||||
// _dicROAPIDLookup.Add(_dicROAPID[appid].roid,appid);
|
||||
// }
|
||||
// String roidkey = roid.Substring(0, 12).ToUpper();
|
||||
// if(_dicROAPIDLookup.ContainsKey(roidkey))
|
||||
// return _dicROAPIDLookup[roidkey];
|
||||
// return null;
|
||||
//}
|
||||
public List<string> GetValueDifferences(ROFSTLookup origROFst, ref List<string> delList)
|
||||
{
|
||||
// use this list to see what differences are between it and the original
|
||||
@ -644,7 +653,7 @@ namespace VEPROMS.CSLA.Library
|
||||
// the first RO with a specific id will be found regardless of the RO Database id.
|
||||
//public rochild GetRoChildFromID(int id)
|
||||
//{
|
||||
// if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);
|
||||
// if (dicRosIntIDs == null) ParseIntoDictionary(_ROFst != null ? _ROFst.ROLookup : _ROFstInfo.ROLookup);
|
||||
// // Use the id to get the value from the dictionary
|
||||
// if (dicRosIntIDs.ContainsKey(id))
|
||||
// {
|
||||
@ -893,10 +902,10 @@ namespace VEPROMS.CSLA.Library
|
||||
{
|
||||
foreach (rochild child in tmp.children)
|
||||
if (!dicRos.ContainsKey(child.roid.ToUpper()))
|
||||
dicRos.Add(child.roid.ToUpper(), child);
|
||||
dicRos.Add(child.roid.ToUpper(), child); // child is a struct not a class.
|
||||
}
|
||||
dicRos.Add(tmp.roid.ToUpper(), tmp);
|
||||
if (!dicRosIntIDs.ContainsKey(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp);
|
||||
//if (!dicRosIntIDs.ContainsKey(tmp.ID)) dicRosIntIDs.Add(tmp.ID, tmp);
|
||||
int j;
|
||||
for (j = i - 1; j >= 0 && tmp.ID < myGrp.children[j].ID; j--)
|
||||
{
|
||||
@ -966,7 +975,7 @@ namespace VEPROMS.CSLA.Library
|
||||
private void ParseIntoDictionary(byte[] ab)
|
||||
{
|
||||
if (dicRos == null) dicRos = new Dictionary<string, rochild>();
|
||||
if (dicRosIntIDs == null) dicRosIntIDs = new Dictionary<int, rochild>();
|
||||
//if (dicRosIntIDs == null) dicRosIntIDs = new Dictionary<int, rochild>();
|
||||
if (dicRoDBs == null) dicRoDBs = new Dictionary<string, string>();
|
||||
|
||||
myHdr.hSize = BitConverter.ToInt32(ab, 0);
|
||||
@ -1202,7 +1211,7 @@ namespace VEPROMS.CSLA.Library
|
||||
else
|
||||
{
|
||||
List<roChild> children = new List<roChild>();
|
||||
children.Add(new roChild(child));
|
||||
children.Add(new roChild(child)); // adding entries to this dictionary for every ro!!
|
||||
_ValueLookupDictionary.Add(value, children);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user