public ICommand CreateCommand()
 {
     using (AddTerrainDecalDialog dlg = new AddTerrainDecalDialog())
     {
         bool showAgain = false;
         ICommand ret = null;
         DialogResult result;
         do
         {
             result = dlg.ShowDialog();
             showAgain = false;
             if (result == DialogResult.OK)
             {
                 // do validation here
                 // if validation fails, set showAgain to true
                 showAgain = ((result == DialogResult.OK) && (!dlg.okButton_validating()));
             }
         } while (showAgain);
         if (result == DialogResult.OK)
         {
             Vector2 size = new Vector2(dlg.SizeX,dlg.SizeZ);
             ret = new AddTerrainDecalCommand(app, parent, dlg.ObjectName, dlg.Filename, size, dlg.Priority);
         }
         return ret;
     }
 }
Example #2
0
 public ICommand CreateCommand()
 {
     using (AddTerrainDecalDialog dlg = new AddTerrainDecalDialog())
     {
         bool         showAgain = false;
         ICommand     ret       = null;
         DialogResult result;
         do
         {
             result    = dlg.ShowDialog();
             showAgain = false;
             if (result == DialogResult.OK)
             {
                 // do validation here
                 // if validation fails, set showAgain to true
                 showAgain = ((result == DialogResult.OK) && (!dlg.okButton_validating()));
             }
         } while (showAgain);
         if (result == DialogResult.OK)
         {
             Vector2 size = new Vector2(dlg.SizeX, dlg.SizeZ);
             ret = new AddTerrainDecalCommand(app, parent, dlg.ObjectName, dlg.Filename, size, dlg.Priority);
         }
         return(ret);
     }
 }