Exemple #1
0
        public int SetField(string fieldName, DVar dvar)
        {
            int index = GetOrAddFieldIndex(fieldName);

            Fields[index] = dvar;
            return(index);
        }
Exemple #2
0
 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;
 }
Exemple #3
0
        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;
        }
Exemple #4
0
        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);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
 public int SetField(string fieldName, DVar dvar)
 {
     int index = GetOrAddFieldIndex(fieldName);
     Fields[index] = dvar;
     return index;
 }
Exemple #7
0
 public override void CopyTo(DVar v) { v.Object = this; }
Exemple #8
0
 public override void CopyTo(DVar v)
 {
     v.Object = this;
 }
Exemple #9
0
 public void Set(DVar v)
 {
     v.Object.CopyTo(this);
 }
Exemple #10
0
 public void Set(DVar v) { v.Object.CopyTo(this); }