public string Add(Type type) { BxAssembly ass = AddAssembly(type.Assembly); Int32 typeID = ass.AddType(type); return(string.Format("{0},{1}", ass.Index, typeID)); }
BxAssembly AddAssembly(Assembly ass) { BxAssembly result = _assList.Find(x => x.Ass == ass); if (result == null) { result = new BxAssembly(ass, _assList.Count); _assList.Add(result); } return(result); }
public void Load(IBxStorageNode node) { IEnumerable <IBxStorageNode> childs = node.ChildNodes; _assList.Clear(); BxAssembly temp; int index = 0; foreach (IBxStorageNode one in childs) { temp = new BxAssembly(null, index); index++; _assList.Add(temp); temp.Load(one); } }
public Type Get(string id) { int pos = id.IndexOf(','); string assID = id.Substring(0, pos); string typeID = id.Substring(pos); if (string.IsNullOrEmpty(id)) { return(null); } Int32 id1, id2; if (Int32.TryParse(assID, out id1)) { BxAssembly ass = _assList[id1]; if (Int32.TryParse(typeID, out id2)) { return(ass.GetType(id2)); } } return(null); }