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

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

Executes the command. Creates, gets parameters and add a Distributed line load to the selected line elements.
public Run ( Canguro services ) : void
services Canguro CommandServices object to interact with the system
Результат void
        public override void Run(Canguro.Controller.CommandServices services)
        {
            if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(this) == System.Windows.Forms.DialogResult.OK)
            {
                DistributedSpanLoad newLoad = new DistributedSpanLoad();
                newLoad.Da = 0;
                newLoad.Db = 1;
                newLoad.Direction = direction;
                newLoad.La = load;
                newLoad.Lb = load;
                newLoad.Type = type;

                List<Item> selection = services.GetSelection();

                foreach (Item item in selection)
                {
                    if (item is LineElement)
                        ((LineElement)item).Loads.Add((DistributedSpanLoad)newLoad.Clone());
                }
            }
        }
UniformLineLoadCmd