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


C# Canguro.ShowDialog方法代码示例

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


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

示例1: Run

        /// <summary>
        /// Executes the command. 
        /// Opens the Sections Dialog
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            SectionsGUI gui = new SectionsGUI();
            if (services.ShowDialog(gui) == System.Windows.Forms.DialogResult.Cancel)
                throw new Canguro.Controller.CancelCommandException();

            services.Model.ChangeModel(true);
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:13,代码来源:SectionsCmd.cs

示例2: Run

 /// <summary>
 /// Executes the command. 
 /// Opens the Materials Dialog.
 /// </summary>
 /// <param name="services">CommandServices object to interact with the system</param>
 public override void Run(Canguro.Controller.CommandServices services)
 {
     Canguro.Commands.Forms.MaterialsGUI gui = new Canguro.Commands.Forms.MaterialsGUI();
     if (services.ShowDialog(gui) != DialogResult.OK)
         throw new Canguro.Controller.CancelCommandException();
 }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:11,代码来源:MaterialsCmd.cs

示例3: Run

        /// <summary>
        /// Executes the command. 
        /// Opens the AnalysisOptionsDialog, creates the export file, sends it to the Server and waits for it to have results.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            gettingResults = false;
            System.Windows.Forms.DialogResult result = services.ShowDialog(new Canguro.Commands.Model.AnalysisOptionsDialog(services));
            string message = "";
            if (result == System.Windows.Forms.DialogResult.Cancel)
            {
                services.Model.Undo.Rollback();
            }
            else if (result == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    System.Windows.Forms.Cursor cursor = System.Windows.Forms.Cursor.Current;
                    bool isConnected;
                    bool canAnalyze = false;
                    JoinCmd.RepairJoints(services.Model);
                    new Canguro.Commands.Model.UnselectCmd().Run(services);
                    if (!(canAnalyze = AnalysisUtils.CanAnalyze(services.Model, ref message, out isConnected)))
                    {
                        if (!isConnected)
                        {
                            if (System.Windows.Forms.MessageBox.Show(message, Culture.Get("error"),
                                System.Windows.Forms.MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error) ==
                                System.Windows.Forms.DialogResult.Yes)
                            {

                                System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

                                new JoinCmd().Run(services);
                                canAnalyze = AnalysisUtils.CanAnalyze(services.Model, ref message, out isConnected);

                                System.Windows.Forms.Cursor.Current = cursor;
                            }
                            else
                                return;
                        }
                    }
                    if (canAnalyze)
                    {
                        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

                        string modelPath = System.IO.Path.GetTempFileName();
                        System.Diagnostics.Debug.WriteLine(modelPath);
                        FixPDelta(services.Model.AbstractCases);

                        Stream stream = File.Create(modelPath);
                        new Canguro.Model.Serializer.Serializer(services.Model).Serialize(stream, false);
                        stream.Close();

                        System.Windows.Forms.Cursor.Current = cursor;

                        System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor;

                        // TODO: ANALYZE STRUCTURE!!!
                        //analysisID = ws.Analyze(userNameURL, passwordURL, host, serial, file, analysisOptions, modelSize, quotation);

                        System.Windows.Forms.Cursor.Current = cursor;

                        services.Model.Results = new Canguro.Model.Results.Results(0);

                        // TODO: GET RESULTS
                        services.ReportProgress(5);
                    }
                    else // Can't analyze
                    {
                        if (!isConnected)
                            message = Culture.Get("structureIsDisconnectedWrn");

                        System.Windows.Forms.MessageBox.Show(message, Culture.Get("error"), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                    }
                }
                catch (Exception)
                {
                    System.Windows.Forms.MessageBox.Show(Culture.Get("ErrorAnalyzing"), Culture.Get("error"), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                }
            }
        }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:83,代码来源:AnalysisCmd.cs

示例4: Run

 /// <summary>
 /// Executes the command. 
 /// Opens the LoadCombinationsDialog
 /// </summary>
 /// <param name="services">CommandServices object to interact with the system</param>
 public override void Run(Canguro.Controller.CommandServices services)
 {
     if (services.ShowDialog(new Canguro.Commands.Forms.LoadCombinationsDialog(services.Model))
         == System.Windows.Forms.DialogResult.Cancel)
         services.Model.Undo.Rollback();
 }
开发者ID:rforsbach,项目名称:Treu-Structure,代码行数:11,代码来源:AddLoadCombinationCmd.cs


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