/// <summary> /// Initialization /// </summary> protected void Initialize() { Assembly ass = null; if (BinaryLoader.Object != null) { byte[] b = BinaryLoader.Object[filename]; if (b != null) { byte[] bytesOut; ass = Load(b, out bytesOut); } } if (ass == null) { ass = Assembly.LoadFile(filename); } IObjectFactory factory = GetFactory(ass); theObject = factory[name]; childern[0] = theObject; if (Object != null) { theObject.SetAssociatedObject(Object); } IPropertiesEditor pe = theObject.GetObject <IPropertiesEditor>(); if ((properties != null) & (pe != null)) { pe.Properties = properties; } }
public override void CreateForm() { if (bmp is IPropertiesEditor) { IPropertiesEditor pe = bmp as IPropertiesEditor; form = (pe.Editor as object[])[0] as Form; return; } form = new FormSourceBitmap(this); }
void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("Bytes", bytes, typeof(byte[])); info.AddValue("Name", name, typeof(string)); if (theArrow != null) { IPropertiesEditor pe = theArrow.GetLabelObject <IPropertiesEditor>(); if (pe != null) { object prop = pe.Properties; info.AddValue("Properties", prop, typeof(object)); } } }
/// <summary> /// ISerializable interface implementation /// </summary> /// <param name="info">Serialization info</param> /// <param name="context">Streaming context</param> public void GetObjectData(SerializationInfo info, StreamingContext context) { info.AddValue("FileName", filename); info.AddValue("Name", name); if (theObject != null) { IPropertiesEditor pe = theObject.GetObject <IPropertiesEditor>(); if (pe != null) { object prop = pe.Properties; info.AddValue("Properties", prop, typeof(object)); } } }
IObjectLabelUI IDefaultLabelFactory.CreateObjectLabel(ICategoryObject obj) { IPropertiesEditor pe = obj.GetObject <IPropertiesEditor>(); if (pe != null) { object ob = pe.Properties; if (ob is object[]) { object[] o = ob as object[]; if (o.Length >= 2) { object oi = o[1]; } } } return(null); }
/// <summary> /// Initialization /// </summary> protected void init() { byte[] bytesOut = null; int i = 0; List <byte[]> lb = new List <byte[]>(bytes); foreach (byte[] b in lb) { assembly = LibraryObjectWrapper.Load(b, out bytesOut); if (bytesOut != null) { bytes[i] = bytesOut; } ++i; } IObjectFactory factory = Factory; theObject = factory[name]; childern[0] = theObject; IPropertiesEditor pe = theObject.GetObject <IPropertiesEditor>(); if ((properties != null) & (pe != null)) { pe.Properties = properties; } if (bytesOut != null) { Interfaces.ISeparatedAssemblyEditedObject ine = theObject.GetObject <Interfaces.ISeparatedAssemblyEditedObject>(); if (ine != null) { ine.FirstLoad(); } } if (Object != null) { theObject.SetAssociatedObject(Object); } }
Control Recursion(object child) { if (child is IPropertiesEditor) { IPropertiesEditor ed = child as IPropertiesEditor; object o = ed.Editor; if (o is object[]) { object[] oo = o as object[]; foreach (object ob in oo) { if ((ob is Control) & !(ob is Form)) { Control c = ob as Control; //c.Dock = DockStyle.Fill; //anelCenter.Controls.Add(c); return(c); } } } } if (child is IChildrenObject) { IChildrenObject chl = child as IChildrenObject; IAssociatedObject[] ao = chl.Children; foreach (object aa in ao) { Control cc = Recursion(aa); if (cc != null) { return(cc); } } } return(null); }
/// <summary> /// Creates object editor form of property editor object /// </summary> /// <param name="obj">The property editor ofject</param> /// <returns>The property editor form</returns> static public Form CreateEditorForm(object obj) { if (obj is IAssociatedObject) { IAssociatedObject ao = obj as IAssociatedObject; IPropertiesEditor pe = ao.GetObject <IPropertiesEditor>(); if (pe != null) { object ob = pe.Editor; if (ob != null) { if (ob is Form) { Form f = ob as Form; return(f); } if (ob is Array) { Array arr = ob as Array; object h = arr.GetValue(0); if (h is Form) { Form f = h as Form; return(f); } } } } } if (obj is MultiLibraryObject) { MultiLibraryObject mo = obj as MultiLibraryObject; IObjectLabel lab = mo.Object as IObjectLabel; return(new FormMultilibrary(lab)); } return(null); }
static internal Image GetImage(ObjectLabel label) { Image im = label.button.ButtonImage as Image; if (im != null) { return(im); } if (label.Object == null) { return(im); } IPropertiesEditor pe = label.Object.GetLabelObject <IPropertiesEditor>(); if (pe != null) { object o = pe.Editor; if (o is Array) { Array arr = o as Array; if (arr.Length > 1) { object image = arr.GetValue(1); if (image is Image) { im = image as Image; } if (image is Icon) { Icon ic = image as Icon; im = ic.ToBitmap(); } } } } return(im); }
/// <summary> /// Saves editor object /// </summary> /// <param name="editor">The editor</param> /// <param name="info">Serialization info</param> public static void Save(this IPropertiesEditor editor, SerializationInfo info) { info.AddValue("Properties", editor.Properties, typeof(object)); }
/// <summary> /// Loads editor object /// </summary> /// <param name="editor">The editor</param> /// <param name="info">Serialization info</param> public static void Load(this IPropertiesEditor editor, SerializationInfo info) { editor.Properties = info.GetValue("Properties", typeof(object)); }