예제 #1
0
 protected override void Bind(Maestro.Editors.IEditorService service)
 {
     panelBody.Controls.Clear();
     var ssym = service.GetEditedResource() as ISimpleSymbolDefinition;
     var csym = service.GetEditedResource() as ICompoundSymbolDefinition;
     if (ssym != null)
     {
         var ssymCtrl = new SimpleSymbolDefinitionEditorCtrl();
         ssymCtrl.Dock = DockStyle.Fill;
         panelBody.Controls.Add(ssymCtrl);
         ssymCtrl.Bind(service);
     }
     else if (csym != null)
     {
         var csymCtrl = new CompoundSymbolDefinitionEditorCtrl();
         csymCtrl.Dock = DockStyle.Fill;
         panelBody.Controls.Add(csymCtrl);
         csymCtrl.Bind(service);
     }
 }
예제 #2
0
 private Control CreateEditor(ISymbolInstance symRef, IResourceService resSvc)
 {
     Check.NotNull(symRef, "symRef"); //NOXLATE
     if (symRef.Reference.Type == SymbolInstanceType.Reference)
     {
         return new ReferenceCtrl((ISymbolInstanceReferenceLibrary)symRef.Reference, resSvc);
     }
     else
     {
         var inline = (ISymbolInstanceReferenceInline)symRef.Reference;
         var symEditor = new SymbolEditorService(_edSvc, inline.SymbolDefinition);
         if (inline.SymbolDefinition.Type == SymbolDefinitionType.Simple)
         {
             var sed = new SimpleSymbolDefinitionEditorCtrl();
             sed.Bind(symEditor);
             return sed;
         }
         else
         {
             var sed = new CompoundSymbolDefinitionEditorCtrl();
             sed.Bind(symEditor);
             return sed;
         }
     }
 }