Пример #1
0
        /// <summary>
        /// Open a dialog for downloading a new weather file
        /// </summary>
        public void DownloadWeather()
        {
            Model model = this.ApsimXFile.FindByPath(this.CurrentNodePath)?.Value as Model;

            if (model != null)
            {
                Utility.WeatherDownloadDialog dlg = new Utility.WeatherDownloadDialog();
                IModel currentNode = ApsimXFile.FindByPath(CurrentNodePath)?.Value as IModel;
                dlg.ShowFor(model, (view as ExplorerView), currentNode, this);
            }
        }
Пример #2
0
        /// <summary>User has attempted to move the current node up.</summary>
        /// <param name="sender">Sender object</param>
        /// <param name="e">Event arguments</param>
        private void OnMoveUp(object sender, EventArgs e)
        {
            try
            {
                Model model = ApsimXFile.FindByPath(view.Tree.SelectedNode)?.Value as Model;

                if (model != null && model.Parent != null)
                {
                    IModel firstModel = model.Parent.Children[0];
                    if (model != firstModel)
                    {
                        CommandHistory.Add(new MoveModelUpDownCommand(model, true));
                    }
                }
            }
            catch (Exception err)
            {
                MainPresenter.ShowError(err);
            }
        }