예제 #1
0
        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);
        }
예제 #2
0
        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;
            //        }
            //    }
            //}
        }
예제 #3
0
파일: Array.cs 프로젝트: hunpody/psimulex
 /// <summary>
 /// Converting from scalar.
 /// </summary>
 /// <param name="value"></param>
 public Array(BaseType value)
     : this(value.Type, 1)
 {
     rep[0] = value.Clone();
 }
예제 #4
0
 public override void Add(BaseType value)
 {
     if (value.Type.TypeEnum == this.Type.TypeEnum)
     {
         AddRange(value);
     }
     else
     {
         rep.Add(value.Clone());
     }
     OnChanged();
 }
예제 #5
0
 public AbstractList(BaseType value)
 {
     rep.Add(value.Clone());
 }
예제 #6
0
 public virtual void AddRange(BaseType value)
 {
     rep.AddRange(value.Clone().ToList().AsEnumerable());
     OnChanged();
 }