예제 #1
0
 public void OnAfterDeserialize()
 {
     if (null != serializedMM_Target)
     {
         _editorWindow = serializedMM_Target;
     }
 }
예제 #2
0
        public static void InsertCSharpCode(this IEditorWindow editorWindow)
        {
            var example = new XElement("host", new XElement("code", new XAttribute("lang", "C#"), new XCData("class Sample {")));

            editorWindow.AppendEcmaNode(example);
            editorWindow.AppendPara();
        }
예제 #3
0
        public Editor(IEditorWindow editorWindow)
        {
            this.editorWindow = editorWindow;
            selectedNode      = new ArrayList();

            instance = this;
        }
예제 #4
0
        public static void InsertFSharpExample(this IEditorWindow editorWindow)
        {
            var example = new XElement("host", new XElement("example", new XElement("code", new XAttribute("lang", "F#"), new XCData("let sample = "))));

            editorWindow.AppendEcmaNode(example);
            editorWindow.AppendPara();
        }
                public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag,
                                 Type[] allowedTypes, StateMachineEditorStyle style,
                                 TimelineScrollArea.eTimeFormat timeFormat = TimelineScrollArea.eTimeFormat.Default)
                {
                    _title                    = title;
                    _editorPrefsTag           = editorPrefsTag;
                    _allowedEvents            = allowedTypes;
                    _style                    = style;
                    _timelineEditorTimeFormat = timeFormat;

                    string editorPrefsText = ProjectEditorPrefs.GetString(_editorPrefsTag, "");

                    try
                    {
                        _editorPrefs = Serializer.FromString <StateMachineEditorPrefs>(editorPrefsText);
                    }
                    catch
                    {
                        _editorPrefs = null;
                    }

                    if (_editorPrefs == null)
                    {
                        _editorPrefs = new StateMachineEditorPrefs();
                    }

                    SetEditorWindow(editorWindow);
                    CreateViews();
                }
예제 #6
0
 public MainWindow()
 {
     _returnButton = new Button
     {
         Text     = "Return to main menu",
         Callback = ReturnToMainMenu
     };
     _buttons.AddElement(new Button
     {
         Text     = "Message Checker",
         Callback = ViewMessageChecker
     });
     _buttons.AddElement(new Button
     {
         Text     = "Message Listing",
         Callback = ViewMessageList
     });
     _buttons.AddElement(new Button
     {
         Text     = "Contributing",
         Callback = ViewContributing
     });
     _buttons.AddElement(new Button
     {
         Text     = "GitHub Page",
         Callback = OpenGitHub
     });
     _buttons.AddElement(new Button
     {
         Text     = "Join Live Chat (Discord)",
         Callback = JoinDiscord
     });
     _currentWindow = this;
 }
예제 #7
0
 // Turns the provided ECMA XML node into HTML and appends it to the current node on the rendered HTML
 public static void AppendEcmaNode(this IEditorWindow editorWindow, XElement ecmaXml)
 {
     if (editorWindow.CurrentObject != null)
     {
         var html = DocConverter.ToHtml(ecmaXml, "", editorWindow.CurrentObject.DocumentDirectory);
         editorWindow.RunJS("insertHtmlAfterCurrentNode", WebViewExtensions.EscapeHtml(html));
     }
 }
예제 #8
0
        public static void InsertList(this IEditorWindow editorWindow)
        {
            var list = new XElement("list", new XAttribute("type", "bullet"),
                                    new XElement("item", new XElement("term", new XText("Text1"))),
                                    new XElement("item", new XElement("term", new XText("Text2"))));

            editorWindow.AppendEcmaNode(new XElement("host", list));
        }
예제 #9
0
        void onEditor_Closed(object sender, EventArgs e)
        {
            IEditorWindow w = sender as IEditorWindow;

            if (mOpendDocuments.Contains(w))
            {
                mOpendDocuments.Remove(w);
            }
        }
예제 #10
0
        public static void InsertTable(this IEditorWindow editorWindow)
        {
            var table = new XElement("list", new XAttribute("type", "table"),
                                     new XElement("listheader",
                                                  new XElement("term", new XText("Term")),
                                                  new XElement("description", new XText("Description"))),
                                     new XElement("item",
                                                  new XElement("term", new XText("Term1")),
                                                  new XElement("description", new XText("Description1"))),
                                     new XElement("item",
                                                  new XElement("term", new XText("Term2")),
                                                  new XElement("description", new XText("Description2"))));

            editorWindow.AppendEcmaNode(new XElement("Host", table));
        }
예제 #11
0
        public static void SaveCurrentObject(this IEditorWindow editorWindow)
        {
            var editable = editorWindow.CurrentObject as IEditableNode;

            if (editable != null)
            {
                string error;

                editorWindow.CheckContents();

                if (!editable.Save(editorWindow, out error))
                {
                    // FIXME: popup a window or something.
                }
            }
        }
                public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag)
                {
                    _title          = title;
                    _editorPrefsTag = editorPrefsTag;

                    string editorPrefsText = ProjectEditorPrefs.GetString(_editorPrefsTag, "");

                    _editorPrefs = Serializer.FromString <NodeGraphEditorPrefs>(editorPrefsText);

                    if (_editorPrefs == null)
                    {
                        _editorPrefs = new NodeGraphEditorPrefs();
                    }

                    SetEditorWindow(editorWindow);
                    CreateViews();
                }
예제 #13
0
        public static void CheckContents(this IEditorWindow editorWindow)
        {
            var dirtyNodes = editorWindow.RunJS("getDirtyNodes").Split(new char [] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            if (dirtyNodes.Length == 0)
            {
                return;
            }

            if (editorWindow.CurrentObject != null && editorWindow.CurrentObject is IEditableNode)
            {
                string result;
                try {
                    result = (editorWindow.CurrentObject as IEditableNode).ValidateChanges(editorWindow, dirtyNodes);
                } catch (Exception e) {
                    result = e.ToString();
                }

                editorWindow.UpdateStatus(result ?? "OK");
            }
        }
                public void Init(string title, IEditorWindow editorWindow, string editorPrefsTag,
                                 Type[] allowedTypes, TimelineStateMachineEditorStyle style,
                                 TimelineScrollArea.eTimeFormat timeFormat = TimelineScrollArea.eTimeFormat.Seconds)
                {
                    _title          = title;
                    _editorPrefsTag = editorPrefsTag;
                    _allowedEvents  = allowedTypes;
                    _style          = style;
                    _timeFormat     = timeFormat;

                    string editorPrefsText = EditorPrefs.GetString(_editorPrefsTag, "");

                    _editorPrefs = SerializeConverter.FromString <TimelineStateMachineEditorPrefs>(editorPrefsText);

                    if (_editorPrefs == null)
                    {
                        _editorPrefs = new TimelineStateMachineEditorPrefs();
                    }

                    SetEditorWindow(editorWindow);
                    CreateViews();
                }
예제 #15
0
 public static void Init(IEditorWindow editorWindow)
 {
     new Editor(editorWindow);
 }
예제 #16
0
 public static void InsertReference(this IEditorWindow editorWindow, string text = null)
 {
     editorWindow.InsertReference(editorWindow.CurrentObject, text);
 }
예제 #17
0
 public ForgeEditor()
 {
     _mainWindow = new MainWindow {
         WindowHandle = this
     };
 }
예제 #18
0
 public static void AppendPara(this IEditorWindow editorWindow)
 {
     editorWindow.AppendEcmaNode(new XElement("para", new XText(".")));
 }
 protected void SetEditorWindow(IEditorWindow editorWindow)
 {
     _editorWindow = editorWindow;
 }
예제 #20
0
파일: Editor.cs 프로젝트: fengye/Path-GPL
 public static void Init( IEditorWindow editorWindow )
 {
     new Editor( editorWindow );
 }
예제 #21
0
파일: Editor.cs 프로젝트: fengye/Path-GPL
        public Editor( IEditorWindow editorWindow )
        {
            this.editorWindow = editorWindow;
            selectedNode = new ArrayList();

            instance = this;
        }
예제 #22
0
 private void ChangeWindow(IEditorWindow window)
 {
     _currentWindow            = window;
     WindowHandle.titleContent = new GUIContent(window.Name);
 }
예제 #23
0
 public JSONObjectEditor(IEditorWindow editorWindow)
 {
     _editorWindow           = editorWindow;
     Undo.undoRedoPerformed += UndoRedoCallback;
     _controlID              = GUIUtility.GetControlID(FocusType.Passive);
 }
예제 #24
0
 public static void InsertHtmlH2(this IEditorWindow editorWindow)
 {
     editorWindow.AppendEcmaNode(new XElement("host", new XElement("format", new XAttribute("type", "text/html"), new XElement("h2", new XText("Header")))));
 }
예제 #25
0
 public JSONObjectGridBasedEditor(IEditorWindow editorWindow) : base(editorWindow)
 {
 }