public int SetField(string fieldName, DVar dvar) { int index = GetOrAddFieldIndex(fieldName); Fields[index] = dvar; return(index); }
public int GetOrAddFieldIndex(string fieldName) { int fieldIndex = DType.IndexOf(fieldName); if (fieldIndex == DType.InvalidIndex) { SetType(new DType(fieldName, DType)); fieldIndex = DType.FieldIndex; } if (Fields[fieldIndex] == null) Fields[fieldIndex] = new DVar(); return fieldIndex; }
public DVar[] Fields = new DVar[12]; //This is explicityly left unprotected to reduce access overhead public DType SetType(DType type) { if (!DType.IsParentOf(type)) throw new Exception(string.Format("Type {0} is not a parent of tyoe {1} and so cannot be extended", DType, type)); DType = type; var maxFieldIndex = DType.FieldIndex; if (maxFieldIndex >= Fields.Length) { var newFields = new DVar[Fields.Length + 10]; Array.Copy(Fields, newFields, Fields.Length); Fields = newFields; } return type; }
public int GetOrAddFieldIndex(string fieldName) { int fieldIndex = DType.IndexOf(fieldName); if (fieldIndex == DType.InvalidIndex) { SetType(new DType(fieldName, DType)); fieldIndex = DType.FieldIndex; } if (Fields[fieldIndex] == null) { Fields[fieldIndex] = new DVar(); } return(fieldIndex); }
public DVar[] Fields = new DVar[12]; //This is explicityly left unprotected to reduce access overhead public DType SetType(DType type) { if (!DType.IsParentOf(type)) { throw new Exception(string.Format("Type {0} is not a parent of tyoe {1} and so cannot be extended", DType, type)); } DType = type; var maxFieldIndex = DType.FieldIndex; if (maxFieldIndex >= Fields.Length) { var newFields = new DVar[Fields.Length + 10]; Array.Copy(Fields, newFields, Fields.Length); Fields = newFields; } return(type); }
public int SetField(string fieldName, DVar dvar) { int index = GetOrAddFieldIndex(fieldName); Fields[index] = dvar; return index; }
public override void CopyTo(DVar v) { v.Object = this; }
public void Set(DVar v) { v.Object.CopyTo(this); }