当前位置: 首页>>代码示例>>C#>>正文


C# Canguro.Run方法代码示例

本文整理汇总了C#中Canguro.Run方法的典型用法代码示例。如果您正苦于以下问题:C# Canguro.Run方法的具体用法?C# Canguro.Run怎么用?C# Canguro.Run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Canguro的用法示例。


在下文中一共展示了Canguro.Run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

 /// <summary>
 /// Executes the command. 
 /// Execute CopyCmd and PasteCmd until cancelled.
 /// </summary>
 /// <param name="services">CommandServices object to interact with the system</param>
 public override void Run(Canguro.Controller.CommandServices services)
 {
     services.Run(new CopyCmd());
     PasteCmd cmd;
     do
     {
         services.Run(cmd = new PasteCmd());
         services.Model.ChangeModel();
     }
     while (cmd.ObjectCount > 0);
 }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:16,代码来源:CopyPasteCmd.cs

示例2: Run

 /// <summary>
 /// Executes the command. 
 /// Opens the Open File Dialog and Loads the selected tsm file.
 /// Asks to save changes if needed.
 /// </summary>
 /// <param name="services">CommandServices object to interact with the system</param>
 public override void Run(Canguro.Controller.CommandServices services)
 {
     if (services.Model.Modified)
     {
         DialogResult dr = MessageBox.Show(Culture.Get("askSaveChangesAndExit"), Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
         if (dr == DialogResult.Cancel)
             return;
         else if (dr == DialogResult.Yes)
             services.Run(new SaveModelCmd());
     }
     string path = "";
     System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
     dlg.Filter = "Treu Structure Model (*.tsm)|*.tsm";
     dlg.DefaultExt = "tsm";
     dlg.AddExtension = true;
     dlg.Title = Culture.Get("OpenFileTitle");
     if (services.Model.CurrentPath.Length > 0)
         dlg.FileName = services.Model.CurrentPath;
     dlg.CheckPathExists = true;
     if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         path = dlg.FileName;
     try
     {
         if (path.Length > 0)
         {
             services.Model.Load(path);
         }
     }
     catch
     {
         MessageBox.Show(Culture.Get("errorLoadingFile") + " " + path, Culture.Get("error"),
             MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:40,代码来源:OpenModelCmd.cs

示例3: Run

        /// <summary>
        /// Executes the command. 
        /// Asks to save changes if needed and Resets the current Model.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            try
            {
                if (services.Model.Modified)
                {
                    DialogResult dr = MessageBox.Show(Culture.Get("askSaveChangesAndExit"), Application.ProductName, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning);
                    if (dr == DialogResult.Cancel)
                        return;
                    else if (dr == DialogResult.Yes)
                        services.Run(new SaveModelCmd());
                }

                services.Model.Reset();
            }
            catch (Exception)
            {
                MessageBox.Show("Error creating new file.");
            }
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:25,代码来源:NewModelWizard.cs


注:本文中的Canguro.Run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。