コード例 #1
0
 public void OnAfterDeserialize()
 {
     if (null != serializedMM_Target)
     {
         _editorWindow = serializedMM_Target;
     }
 }
コード例 #2
0
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
        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
ファイル: Editor.cs プロジェクト: hardikbhalodi/Path-GPL
        public Editor(IEditorWindow editorWindow)
        {
            this.editorWindow = editorWindow;
            selectedNode      = new ArrayList();

            instance = this;
        }
コード例 #4
0
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
        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();
        }
コード例 #5
0
                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
ファイル: MainWindow.cs プロジェクト: BrentFarris/ForgeAlloy
 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
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
 // 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
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
        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
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
        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
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
        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.
                }
            }
        }
コード例 #12
0
                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
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
        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");
            }
        }
コード例 #14
0
                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
ファイル: Editor.cs プロジェクト: hardikbhalodi/Path-GPL
 public static void Init(IEditorWindow editorWindow)
 {
     new Editor(editorWindow);
 }
コード例 #16
0
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
 public static void InsertReference(this IEditorWindow editorWindow, string text = null)
 {
     editorWindow.InsertReference(editorWindow.CurrentObject, text);
 }
コード例 #17
0
ファイル: ForgeEditor.cs プロジェクト: BrentFarris/ForgeAlloy
 public ForgeEditor()
 {
     _mainWindow = new MainWindow {
         WindowHandle = this
     };
 }
コード例 #18
0
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
 public static void AppendPara(this IEditorWindow editorWindow)
 {
     editorWindow.AppendEcmaNode(new XElement("para", new XText(".")));
 }
コード例 #19
0
 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
ファイル: MainWindow.cs プロジェクト: BrentFarris/ForgeAlloy
 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
ファイル: EditorWindow.cs プロジェクト: yerumaku/DocWriter
 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)
 {
 }