コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenameModelCommand"/> class.
 /// </summary>
 /// <param name="modelToRename">The model to rename.</param>
 /// <param name="newName">The new name.</param>
 /// <param name="explorerView">The explorer view.</param>
 public RenameModelCommand(Model modelToRename, string newName, Interfaces.IExplorerView explorerView)
 {
     if (modelToRename.ReadOnly)
     {
         throw new ApsimXException(modelToRename, string.Format("Unable to rename {0} - it is read-only.", modelToRename.Name));
     }
     this.modelToRename = modelToRename;
     this.newName       = newName.Trim();
     this.explorerView  = explorerView;
 }
コード例 #2
0
ファイル: RenameModelCommand.cs プロジェクト: hol353/ApsimX
 /// <summary>
 /// Initializes a new instance of the <see cref="RenameModelCommand"/> class.
 /// </summary>
 /// <param name="modelToRename">The model to rename.</param>
 /// <param name="newName">The new name.</param>
 /// <param name="explorerView">The explorer view.</param>
 public RenameModelCommand(Model modelToRename, string newName, Interfaces.IExplorerView explorerView)
 {
     this.modelToRename = modelToRename;
     this.newName = newName;
     this.explorerView = explorerView;
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RenameModelCommand"/> class.
 /// </summary>
 /// <param name="modelToRename">The model to rename.</param>
 /// <param name="newName">The new name.</param>
 /// <param name="explorerView">The explorer view.</param>
 public RenameModelCommand(Model modelToRename, string newName, Interfaces.IExplorerView explorerView)
 {
     this.modelToRename = modelToRename;
     this.newName       = newName;
     this.explorerView  = explorerView;
 }