Beispiel #1
0
        public Component AddShortCut(Component SourceComponent)
        {
            // ---------------------------------------------------------------------
            // Add the source component as a child shortcut component.
            // ---------------------------------------------------------------------
            MyFile.BeginUpdate();
            Component ShortCutComponent = new Component(MyFile, this, SourceComponent);

            MyChildNodes.Add(ShortCutComponent);
            ShortCutComponent.EnsureNameIsUnique();

            // Now we need to go through all child nodes of the shortcut and make
            // them shortcuts as well.
            foreach (Component Child in SourceComponent.ChildNodes)
            {
                ShortCutComponent.AddShortCut(Child);
            }

            MyFile.EndUpdate();
            MyFile.PublishComponentChanged(this);
            CheckOutputFileNode();
            return(ShortCutComponent);
        }