/// <summary> /// Finishes initializing component by setting up scripting service</summary> void IInitializable.Initialize() { if (m_scriptingService != null) { // load this assembly into script domain. m_scriptingService.LoadAssembly(GetType().Assembly); m_scriptingService.ImportAllTypes("WinGuiCommon"); m_scriptingService.SetVariable("editor", this); m_contextRegistry.ActiveContextChanged += delegate { EditingContext editingContext = m_contextRegistry.GetActiveContext <EditingContext>(); IHistoryContext hist = m_contextRegistry.GetActiveContext <IHistoryContext>(); m_scriptingService.SetVariable("editingContext", editingContext); m_scriptingService.SetVariable("hist", hist); }; } }
/// <summary> /// Finishes initializing component by setting up the scripting service</summary> void IInitializable.Initialize() { if (m_scriptingService != null) { // load this assembly into script domain. m_scriptingService.LoadAssembly(GetType().Assembly); m_scriptingService.ImportAllTypes("FsmEditorSample"); m_scriptingService.ImportAllTypes("Sce.Atf.Controls.Adaptable.Graphs"); m_scriptingService.SetVariable("editor", this); m_contextRegistry.ActiveContextChanged += delegate { EditingContext editingContext = m_contextRegistry.GetActiveContext <EditingContext>(); ViewingContext viewContext = m_contextRegistry.GetActiveContext <ViewingContext>(); IHistoryContext hist = m_contextRegistry.GetActiveContext <IHistoryContext>(); m_scriptingService.SetVariable("editingContext", editingContext); m_scriptingService.SetVariable("fsm", editingContext != null ? editingContext.Fsm : null); m_scriptingService.SetVariable("view", viewContext); m_scriptingService.SetVariable("hist", hist); }; } }
/// <summary> /// Finishes initializing component by setting up scripting service and setting service</summary> void IInitializable.Initialize() { if (m_scriptingService != null) { // load this assembly into script domain. m_scriptingService.LoadAssembly(GetType().Assembly); m_scriptingService.ImportAllTypes("CircuitEditorSample"); m_scriptingService.ImportAllTypes("Sce.Atf.Controls.Adaptable.Graphs"); m_scriptingService.SetVariable("editor", this); m_scriptingService.SetVariable("schemaLoader", m_schemaLoader); m_scriptingService.SetVariable("layerLister", m_layerLister); m_contextRegistry.ActiveContextChanged += delegate { var editingContext = m_contextRegistry.GetActiveContext <CircuitEditingContext>(); ViewingContext viewContext = m_contextRegistry.GetActiveContext <ViewingContext>(); IHistoryContext hist = m_contextRegistry.GetActiveContext <IHistoryContext>(); m_scriptingService.SetVariable("editingContext", editingContext); m_scriptingService.SetVariable("circuitContainer", editingContext != null ? editingContext.CircuitContainer : null); m_scriptingService.SetVariable("view", viewContext); m_scriptingService.SetVariable("hist", hist); }; } if (m_settingsService != null) { var settings = new[] { new BoundPropertyDescriptor(this, () => SnapToGridEnabled, "Snap to grid".Localize(), "Circuit Editor".Localize(), "Snaps circuit element to grid when dragging".Localize(), new BoolEditor(), null), new BoundPropertyDescriptor(typeof(CircuitDefaultStyle), () => CircuitDefaultStyle.EdgeStyle, "Wire Style".Localize(), "Circuit Editor".Localize(), "Default Edge Style".Localize()), new BoundPropertyDescriptor(typeof(CircuitDefaultStyle), () => CircuitDefaultStyle.ShowExpandedGroupPins, "Show Expanded Group Pins".Localize(), "Circuit Editor".Localize(), "Show group pins when a group is expanded".Localize()), new BoundPropertyDescriptor(typeof(CircuitDefaultStyle), () => CircuitDefaultStyle.ShowVirtualLinks, "Show Virtual links".Localize(), "Circuit Editor".Localize(), "Show virtual links between group pin and its associated subnodes when a group is expanded".Localize()), new BoundPropertyDescriptor(this, () => InitialDirectory, "Initial Directory".Localize(), "Circuit Editor".Localize(), "The initial directory for documents".Localize(), new System.Windows.Forms.Design.FolderNameEditor(), null), }; m_settingsService.RegisterUserSettings("Circuit Editor", settings); m_settingsService.RegisterSettings(this, settings); } if (m_modulePlugin != null) { // define pin/connection pens var pen = D2dFactory.CreateSolidBrush(Color.LightSeaGreen); Theme.RegisterCustomBrush(m_modulePlugin.BooleanPinTypeName, pen); pen = D2dFactory.CreateSolidBrush(Color.LightSeaGreen); Theme.RegisterCustomBrush(m_modulePlugin.FloatPinTypeName, pen); } D2dGradientStop[] gradstops = { new D2dGradientStop(Color.White, 0), new D2dGradientStop(Color.MediumVioletRed, 1.0f), }; Theme.RegisterCustomBrush(MissingModule.MissingTypeName, D2dFactory.CreateLinearGradientBrush(gradstops)); CircuitEditingContext.CircuitFormat = CircuitFormat; }
public void Initialize(ScriptingService scriptingService) { scriptingService.LoadAssembly(GetType().Assembly); }