Exemple #1
0
 public void OnExpandChildren(object sender, EventArgs e)
 {
     try
     {
         explorerPresenter.ExpandChildren(explorerPresenter.CurrentNodePath);
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Exemple #2
0
        public void OnPasteClick(object sender, EventArgs e)
        {
            try
            {
                string internalCBText = this.explorerPresenter.GetClipboardText("_APSIM_MODEL");
                string externalCBText = this.explorerPresenter.GetClipboardText("CLIPBOARD");

                string text = string.IsNullOrEmpty(externalCBText) ? internalCBText : externalCBText;

                IModel   currentNode = explorerPresenter.ApsimXFile.FindByPath(explorerPresenter.CurrentNodePath)?.Value as IModel;
                ICommand command     = new AddModelCommand(currentNode, text);
                explorerPresenter.CommandHistory.Add(command, true);
                explorerPresenter.Refresh();
                if (currentNode.Children.Count == 1)
                {
                    explorerPresenter.ExpandChildren(currentNode.FullPath, true);
                }
            }
            catch (Exception err)
            {
                explorerPresenter.MainPresenter.ShowError(err);
            }
        }
Exemple #3
0
 public void OnExpandChildren(object sender, EventArgs e)
 {
     explorerPresenter.ExpandChildren(explorerPresenter.CurrentNodePath);
 }