public Editor( IControlHostService controlHostService, ICommandService commandService, IContextRegistry contextRegistry, IDocumentRegistry documentRegistry, IDocumentService documentService, PrototypeLister prototypeLister, LayerLister layerLister, SchemaLoader schemaLoader) { m_controlHostService = controlHostService; m_commandService = commandService; m_contextRegistry = contextRegistry; m_documentRegistry = documentRegistry; m_documentService = documentService; m_prototypeLister = prototypeLister; m_layerLister = layerLister; m_schemaLoader = schemaLoader; string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\CircuitEditor\\data"); EditorInfo.InitialDirectory = initialDirectory; m_theme = new D2dDiagramTheme(); m_circuitRenderer = new D2dCircuitRenderer<Module, Connection, ICircuitPin>(m_theme, documentRegistry); m_subGraphRenderer = new D2dSubCircuitRenderer<Module, Connection, ICircuitPin>(m_theme); // create d2dcontrol for displaying sub-circuit m_d2dHoverControl = new D2dAdaptableControl(); m_d2dHoverControl.Dock = DockStyle.Fill; var xformAdapter = new TransformAdapter(); xformAdapter.EnforceConstraints = false;//to allow the canvas to be panned to view negative coordinates m_d2dHoverControl.Adapt(xformAdapter, new D2dGraphAdapter<Module, Connection, ICircuitPin>(m_circuitRenderer, xformAdapter)); m_d2dHoverControl.DrawingD2d += new EventHandler(m_d2dHoverControl_DrawingD2d); }
public Editor( IControlHostService controlHostService, ICommandService commandService, IContextRegistry contextRegistry, IDocumentRegistry documentRegistry, IDocumentService documentService, PrototypeLister prototypeLister, LayerLister layerLister, SchemaLoader schemaLoader) { m_controlHostService = controlHostService; m_commandService = commandService; m_contextRegistry = contextRegistry; m_documentRegistry = documentRegistry; m_documentService = documentService; m_prototypeLister = prototypeLister; m_layerLister = layerLister; m_schemaLoader = schemaLoader; string initialDirectory = Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\..\\components\\wws_atf\\Samples\\CircuitEditor\\data"); EditorInfo.InitialDirectory = initialDirectory; m_theme = new D2dDiagramTheme(); m_circuitRenderer = new D2dCircuitRenderer <Module, Connection, ICircuitPin>(m_theme, documentRegistry); m_subGraphRenderer = new D2dSubCircuitRenderer <Module, Connection, ICircuitPin>(m_theme); //// Note: Santa Monica uses following render settings: //m_circuitRenderer.TitleBackgroundFilled = true; //m_circuitRenderer.RoundedBorder = false; //m_circuitRenderer.PinDrawStyle = D2dCircuitRenderer<Module, Connection, ICircuitPin>.PinStyle.OnBorderFilled; //m_subGraphRenderer.TitleBackgroundFilled = true; //m_subGraphRenderer.RoundedBorder = false; //m_subGraphRenderer.PinDrawStyle = D2dCircuitRenderer<Module, Connection, ICircuitPin>.PinStyle.OnBorderFilled; // create d2dcontrol for displaying sub-circuit m_d2dHoverControl = new D2dAdaptableControl(); m_d2dHoverControl.Dock = DockStyle.Fill; var xformAdapter = new TransformAdapter(); xformAdapter.EnforceConstraints = false;//to allow the canvas to be panned to view negative coordinates m_d2dHoverControl.Adapt(xformAdapter, new D2dGraphAdapter <Module, Connection, ICircuitPin>(m_circuitRenderer, xformAdapter)); m_d2dHoverControl.DrawingD2d += new EventHandler(m_d2dHoverControl_DrawingD2d); }