Beispiel #1
0
        public bool DuplicateGridNode()
        {
            int id, length;

            length = SelectedNode.Count;
            for (int i = 0; i < length; i++)
            {
                SelectedNode.Add(new GridNodeAsset(( GridNodeAsset )SelectedNode[i], SelectedNetwork));

                id = 0;
                while ((( GridNetworkAsset )SelectedNetwork).Get((( GridNodeAsset )SelectedNode[length + i]).Name + "-" + (++id)) != null)
                {
                    ;
                }
                (( GridNodeAsset )SelectedNode[length + i]).Name += "-" + id;

                (( GridNetworkAsset )SelectedNetwork).Add((( GridNodeAsset )SelectedNode[length + i]));
            }

            SelectedNode.RemoveRange(0, length);

            SaveCollection();

            return(true);
        }