/// <summary>The execute.</summary>
        public override void Execute()
        {
            // Determine what operations library folder we will open too.
            var libraryLocation = Path.Combine(SettingsManager.SharedDirectory, MachineDefManager.IsCurrentMachineGroupRouter() ? "router\\OPS" : "mill\\Ops");

            // Prompr user to select an operations library(s)
            var operationsLib = this.fileBrowserService.BrowseForFile(this.Parent, LocalizationStrings.PromptForOperationsLibrary, Globals.FileFilterOperations, libraryLocation, true);

            if (!operationsLib.Any())
            {
                return;
            }

            // Notify our subscribers
            var payload = new OperationsLibraryLoadMessage { Libraries = operationsLib };
            this.eventAggregator.Publish(payload);
        }
Ejemplo n.º 2
0
        /// <summary>The execute.</summary>
        public override void Execute()
        {
            // Determine what operations library folder we will open too.
            var libraryLocation = Path.Combine(SettingsManager.SharedDirectory, MachineDefManager.IsCurrentMachineGroupRouter() ? "router\\OPS" : "mill\\Ops");

            // Prompr user to select an operations library(s)
            var operationsLib = this.fileBrowserService.BrowseForFile(this.Parent, ApplicationStrings.PromptForOperationsLibrary, Globals.FileFilterOperations, libraryLocation, true);

            if (!operationsLib.Any())
            {
                return;
            }

            // Notify our subscribers
            var payload = new OperationsLibraryLoadMessage {
                Libraries = operationsLib
            };

            this.eventAggregator.Publish(payload);
        }
        /// <summary>The operations library load event.</summary>
        /// <param name="e">The payload event.</param>
        /// <summary>This event handles loading of the treeview for all operation files selected</summary>
        private void OnOperationsLibraryLoadEvent(OperationsLibraryLoadMessage e)
        {
            var nodes = this.strategyService.LoadOperationData(e.Libraries);
            if (nodes != null)
            {
                FileManager.New(false);

                // Append nodes to the parent node
                this.view.Tree.Nodes[0].Nodes.AddRange(nodes.ToArray());
                this.view.Tree.Nodes[0].Expand();
            }
        }