Exemple #1
0
        IDockContent DeserializeDockContent(string persistString)
        {
            var openCommand = new Commands.OpenPath(persistString, Commands.OpenCommand.OpenStyles.InitialLoad);

            openCommand.Execute(ProjectModel, this);
            if (openCommand.Panel != null)
            {
                openCommand.Panel.InvokeCommand += ProcessControllerCommand;
            }
            return(openCommand.Panel);
        }
Exemple #2
0
        private int TotalDocument(String Path, Model Model, Main View)
        {
            var openCommand = new Commands.OpenPath(Path, Commands.OpenCommand.OpenStyles.Transient);

            openCommand.Execute(Model, View);
            if (openCommand.Document != null)
            {
                return(openCommand.Document.CountWords(Model, View));
            }
            else
            {
                return(0);
            }
        }
Exemple #3
0
        public void Execute(Model Model, Main View)
        {
            var openCommand = new OpenPath(Path, OpenCommand.OpenStyles.Transient);

            openCommand.Execute(Model, View);
            if (openCommand.Document != null)
            {
                Count = openCommand.Document.CountWords(Model, View);
                System.Windows.Forms.MessageBox.Show(String.Format("{0} words", Count),
                                                     "Word count", System.Windows.Forms.MessageBoxButtons.OK);
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("Error", "Word count",
                                                     System.Windows.Forms.MessageBoxButtons.OK);
            }
        }
Exemple #4
0
        public override void Load(Model Model, Main View, string Path)
        {
            this.Path = Path;
            var split      = ParsePathParts(Path);
            var openParent = new Commands.OpenPath(split[0], Commands.OpenCommand.OpenStyles.CreateView);

            openParent.Execute(Model, View);
            if (!openParent.Succeeded)
            {
                throw new InvalidOperationException();
            }
            if (openParent.Document == null)
            {
                throw new InvalidOperationException();
            }
            ParentDocument = openParent.Document;
        }