public override object Clone() { SirenCustomClass val = new SirenCustomClass(Name) { Attribute = Attribute.Clone() as SirenClassAttribute }; val.BaseTypeName = BaseTypeName; val.BaseType = BaseType.Clone() as SirenCustomClass; foreach (var baseSirenCustomType in Types) { val.Types.Add(baseSirenCustomType.Key, baseSirenCustomType.Value.Clone() as BaseSirenCustomType); } foreach (var sirenField in FieldNameDict) { val.FieldNameDict.Add(sirenField.Key, sirenField.Value.Clone() as SirenField); } return(val); }
public void Insert(long key, BaseType value) { int index = rep.FindIndex(item => item.Priority < key); if (index == -1) index = rep.Count; rep.Insert(index, new Pair { Priority = key, Value = value.Clone() }); OnChanged(); //if (Count == 0) //{ // rep.Add(new Pair { Priority = key, Value = value }); //} //else //{ // for (int i = 0; i < Count; i++) // { // if (rep[i].Priority < key) // { // rep.Insert(i, new Pair { Priority = key, Value = value }); // return; // } // } //} }
/// <summary> /// Converting from scalar. /// </summary> /// <param name="value"></param> public Array(BaseType value) : this(value.Type, 1) { rep[0] = value.Clone(); }
public override void Add(BaseType value) { if (value.Type.TypeEnum == this.Type.TypeEnum) { AddRange(value); } else { rep.Add(value.Clone()); } OnChanged(); }
public AbstractList(BaseType value) { rep.Add(value.Clone()); }
public virtual void AddRange(BaseType value) { rep.AddRange(value.Clone().ToList().AsEnumerable()); OnChanged(); }