private void Build(Framework.Parts.IActor actor) { displayProperties = new Utility.PropertyTable(); Proteus.Framework.Parts.IProperty[] properties = currentActor.Properties; foreach (Proteus.Framework.Parts.IProperty p in properties) { // Now set it. TypeConverter converter = TypeDescriptor.GetConverter(p.Type); Type editorType = p.EditorType; Utility.PropertySpec spec = null; if (converter != null && editorType != null) { spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue, editorType, converter.GetType()); } else { spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue); } // Store it. displayProperties.Properties.Add(spec); displayProperties[p.Name] = p.CurrentValue; } propertyGrid1.SelectedObject = displayProperties; displayProperties.SetValue += new Proteus.Editor.Utility.PropertySpecEventHandler(displayProperties_SetValue); }
public virtual bool IsCompatible(Framework.Parts.IActor actor) { if (currentDocument != null) { return(currentDocument.IsCompatible(actor)); } return(false); }
private void CreateDocumentHosts(Framework.Parts.IActor actor) { foreach (string n in documentFormTypes) { DocumentForm newForm = (DocumentForm)Create(n, false); if (newForm.IsCompatible(actor)) { bool alreadyExisting = false; // Search existing forms for this combination foreach (DockableForm f in dockedForms) { if (f is DocumentForm) { DocumentForm docForm = f as DocumentForm; if (object.ReferenceEquals(docForm.Actor, actor)) { alreadyExisting = true; // Push to front. docForm.Show(); topDocumentForm = docForm; Documents.Manager.Instance.TopDocument = docForm.CurrentDocument; } } } if (!alreadyExisting) { newForm.Actor = actor; newForm.Show(dockPanel, newForm.DefaultDockState); topDocumentForm = newForm; Documents.Manager.Instance.TopDocument = newForm.CurrentDocument; } else { dockedForms.Remove(newForm); newForm.Dispose(); } } else { dockedForms.Remove(newForm); newForm.Dispose(); } } }
private ActorNode FindStep(TreeNodeCollection nodes, Framework.Parts.IActor actor) { foreach (ActorNode n in nodes) { if (n.Actor == actor) { return(n); } ActorNode subNode = FindStep(n.Nodes, actor); if (subNode != null) { return(subNode); } } return(null); }
private ActorNode BuildStep(Framework.Parts.IActor actor) { if (actor != null) { ActorNode newNode = new ActorNode(); newNode.Text = actor.Name; newNode.ToolTipText = actor.TypeName; newNode.Actor = actor; Framework.Parts.IActorCollection collection = actor.QueryInterface <Framework.Parts.IActorCollection>(); if (collection != null) { foreach (Framework.Parts.IActor a in collection) { newNode.Nodes.Add(BuildStep(a)); } } return(newNode); } return(null); }
private ActorNode FindNode(Framework.Parts.IActor actor) { return(FindStep(treeView1.Nodes, actor)); }
public abstract bool IsCompatible(Framework.Parts.IActor actor);
private void Build(Framework.Parts.IActor actor) { }