Canguro.Commands.Load.AddLoadCaseCmd.Run C# (CSharp) Метод

Run() публичный Метод

Executes the command. Gets the Load Case properties from the User, adds it to the Model and sets it as Active.
public Run ( Canguro services ) : void
services Canguro CommandServices object to interact with the system
Результат void
        public override void Run(Canguro.Controller.CommandServices services)
        {
            string name = Culture.Get("defaultLoadCase");
            LoadCase lCase = new LoadCase(name, LoadCase.LoadCaseType.Dead);
            lCase.Name = name;
            //            services.GetProperties(lCase.Name, lCase, false);

            EditLoadCaseDialog dlg = new EditLoadCaseDialog(lCase);
            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (!services.Model.LoadCases.ContainsKey(lCase.Name))
                    services.Model.LoadCases.Add(lCase.Name, lCase);
                services.Model.ActiveLoadCase = lCase;

                AnalysisCase aCase = new AnalysisCase(lCase.Name);
                StaticCaseProps props = aCase.Properties as StaticCaseProps;
                if (props != null)
                {
                    List<StaticCaseFactor> list = props.Loads;
                    list.Add(new StaticCaseFactor(lCase));
                    props.Loads = list;
                    services.Model.AbstractCases.Add(aCase);
                }
            }
            else
                services.Model.Undo.Rollback();
        }
AddLoadCaseCmd