示例#1
0
        private static void DoCreateFragment(string subject, TextFormat textFormat, string text,
                                             string sourceUrl, IResource baseResource)
        {
            IResource fragment = CreateFragmentResource(subject, textFormat, text, sourceUrl, baseResource);

            FragmentEditPane editPane = new FragmentEditPane();

            Core.UIManager.OpenResourceEditWindow(editPane, fragment, true, OnFragmentSaved, editPane);
        }
示例#2
0
        private static void OnFragmentSaved(IResource res, object tag)
        {
            Core.WorkspaceManager.AddToActiveWorkspace(res);
            Core.TextIndexManager.QueryIndexing(res.Id);
            Core.FilterEngine.ExecRules(StandardEvents.ResourceReceived, res);
            FragmentEditPane editPane = (FragmentEditPane)tag;

            if (editPane != null && editPane.OpenAfterSave)
            {
                Core.ResourceBrowser.DisplayResource(res);
                if (!Core.ResourceBrowser.LinksPaneExpanded)
                {
                    Core.ResourceBrowser.ContentChanged += OnResorceBrowserContentChanged;
                }
                Core.ResourceBrowser.LinksPaneExpanded = true;
            }
        }