Пример #1
0
 public EditableObjectReference(EditorController controller, Element obj, Element parent, string attribute)
 {
     m_object = obj;
     m_controller = controller;
     m_parent = parent;
     m_attribute = attribute;
 }
Пример #2
0
        public ScriptCommandEditorData(EditorController controller, IEditableScript script)
        {
            m_controller = controller;
            m_script = script;

            m_script.Updated += m_script_Updated;
        }
Пример #3
0
 public EditableCommandPattern(EditorController controller, EditorCommandPattern pattern, Element parent, string attribute)
 {
     m_pattern = pattern;
     m_controller = controller;
     m_parent = parent;
     m_attribute = attribute;
 }
Пример #4
0
        internal EditableIfScript(EditorController controller, IfScript script, UndoLogger undoLogger)
            : base(controller, script, undoLogger)
        {
            m_ifScript = script;

            m_ifScript.IfScriptUpdated += m_ifScript_IfScriptUpdated;

            if (m_ifScript.ThenScript == null)
            {
                m_ifScript.ThenScript = new MultiScript();
            }

            m_thenScript = EditableScripts.GetInstance(Controller, m_ifScript.ThenScript);
            m_thenScript.Updated += nestedScript_Updated;

            foreach (var elseIfScript in m_ifScript.ElseIfScripts)
            {
                EditableElseIf newEditableElseIf = new EditableElseIf(elseIfScript, this);
                m_elseIfScripts.Add(elseIfScript.Script, newEditableElseIf);
                newEditableElseIf.EditableScripts.Updated += nestedScript_Updated;
            }

            if (m_ifScript.ElseScript != null)
            {
                m_elseScript = EditableScripts.GetInstance(Controller, m_ifScript.ElseScript);
                m_elseScript.Updated += nestedScript_Updated;
            }
        }
Пример #5
0
        public EditorData(Element element, EditorController controller)
        {
            m_element = element;
            m_controller = controller;

            element.Fields.AttributeChanged += Fields_AttributeChanged;
            element.Fields.AttributeChangedSilent += Fields_AttributeChanged;
        }
Пример #6
0
 public EditableScriptBase(EditorController controller, IScript script, UndoLogger undoLogger)
 {
     Script = script;
     m_controller = controller;
     if (script != null)
     {
         ((IMutableField)script).UndoLog = undoLogger;
     }
 }
Пример #7
0
 public void Init()
 {
     m_controller = new EditorController();
     m_controller.ClearTree += new EditorController.VoidHandler(m_controller_ClearTree);
     m_controller.BeginTreeUpdate += new EditorController.VoidHandler(m_controller_BeginTreeUpdate);
     m_controller.EndTreeUpdate += new EditorController.VoidHandler(m_controller_EndTreeUpdate);
     m_controller.AddedNode += new EditorController.AddedNodeHandler(m_controller_AddedNode);
     m_controller.UndoListUpdated += new EventHandler<EditorController.UpdateUndoListEventArgs>(m_controller_UndoListUpdated);
     m_controller.RedoListUpdated += new EventHandler<EditorController.UpdateUndoListEventArgs>(m_controller_RedoListUpdated);
     m_controller.Initialise(@"..\..\..\EditorControllerTests\test.aslx");
     DoExtraInitialisation();
 }
Пример #8
0
        internal EditableScriptFactory(EditorController controller, ScriptFactory factory, WorldModel worldModel)
        {
            m_controller = controller;
            m_scriptFactory = factory;
            m_worldModel = worldModel;

            foreach (Element editor in worldModel.Elements.GetElements(ElementType.Editor).Where(e => IsScriptEditor(e)))
            {
                string appliesTo = editor.Fields.GetString("appliesto");
                m_scriptData.Add(appliesTo, new EditableScriptData(editor));
            }
        }
Пример #9
0
        public static void EditScript(EditorController controller, ref IEditableScripts scripts, string attribute, string element, bool isReadOnly, Action dirtyAction)
        {
            ScriptEditorPopOut popOut = new ScriptEditorPopOut();

            popOut.ctlScriptEditor.HidePopOutButton();
            popOut.ctlScriptEditor.Helper.DoInitialise(controller, null);
            popOut.ctlScriptEditor.Populate(scripts);
            popOut.ctlScriptEditor.Helper.Dirty += (object sender, DataModifiedEventArgs e) => dirtyAction.Invoke();

            popOut.ShowDialog();
            scripts = popOut.ctlScriptEditor.Scripts;
            popOut.ctlScriptEditor.Save();
        }
Пример #10
0
        private EditableScripts(EditorController controller, IScript script)
            : this(controller)
        {
            InitialiseMultiScript((MultiScript)script);
            foreach (IScript scriptItem in m_underlyingScript.Scripts)
            {
                m_scripts.Add(m_controller.ScriptFactory.CreateEditableScript(scriptItem));
            }

            foreach (IEditableScript editableScript in m_scripts)
            {
                editableScript.Updated += script_Updated;
            }

            System.Diagnostics.Debug.Assert(m_underlyingScript.Scripts.Count() == m_scripts.Count);
        }
Пример #11
0
 internal EditableScript(EditorController controller, IScript script, UndoLogger undoLogger)
     : base(controller, script, undoLogger)
 {
     m_editorName = Script.Keyword;
 }
Пример #12
0
 void m_controller_UndoListUpdated(object sender, EditorController.UpdateUndoListEventArgs e)
 {
     m_undoList = new List<string>(e.UndoList);
 }
Пример #13
0
 public static EditableScripts GetInstance(EditorController controller, IScript script)
 {
     return s_wrapper.GetInstance(controller, script);
 }
Пример #14
0
 private EditableScripts(EditorController controller)
 {
     m_controller = controller;
     m_scripts = new List<IEditableScript>();
 }
Пример #15
0
 private static EditableScripts GetNewInstance(EditorController controller, IScript script)
 {
     return new EditableScripts(controller, script);
 }