Canguro.Model.Load.DistributedSpanLoad.Clone C# (CSharp) Method

Clone() public method

public Clone ( ) : object
return object
        public override object Clone()
        {
            object o = base.Clone();
            ((DistributedSpanLoad)o).distances = (float[])distances.Clone();
            ((DistributedSpanLoad)o).loads = (float[])loads.Clone();

            return o;
        }

Usage Example

        /// <summary>
        /// Executes the command. 
        /// Creates, gets parameters and add a Distributed line load to the selected line elements.
        /// </summary>
        /// <param name="services">CommandServices object to interact with the system</param>
        public override void Run(Canguro.Controller.CommandServices services)
        {
            DistributedSpanLoad load = new DistributedSpanLoad();

            //services.GetProperties(Title, load, false);

            if (Canguro.Controller.Grid.LoadEditFrm.EditLoad(load) == System.Windows.Forms.DialogResult.OK)
            {

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

                foreach (Item item in selection)
                {
                    if (item is LineElement)
                        ((LineElement)item).Loads.Add((DistributedSpanLoad)load.Clone());
                }
            }
        }
All Usage Examples Of Canguro.Model.Load.DistributedSpanLoad::Clone
DistributedSpanLoad