public static GraphicsElement Produce(BaseType value) { if (value == null) return new ScalarGraphics(new VapeTeam.Psimulex.Core.Types.String("NULL")); switch (value.Type.TypeEnum) { case TypeEnum.Integer: return new ScalarGraphics(value); case TypeEnum.Array: return new ArrayGraphics(value.ToArray()); case TypeEnum.Tree: return new TreeGraphics(value.ToTree()); case TypeEnum.BinaryTree: return new TreeGraphics(value.ToBinaryTree()); default: if (TypeHierarchy.IsContainer(value)) { return new ArrayGraphics(value as AbstractCollection); } return new ScalarGraphics(value); } }
public override void Assign(BaseType value) { var otherArray = value.ToArray(); if (otherArray.Size > this.Size) Resize(otherArray.Size); for (int i = 0; i < otherArray.Size; ++i) { rep[i] = otherArray.rep[i].Clone().ConvertTo(InitializatorType); } OnChanged(); //if( size != 0 ) // base.Assign(value); //else //{ // rep.Clear(); // foreach (var item in value.ToArray().AsEnumerable()) // { // rep.Add(item); // } // this.size = value.ToArray().Size; // this.InitializatorType = value.ToArray().InitializatorType; //} }