コード例 #1
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");
            }
        }