예제 #1
0
        public void OnItemAdded(object sender, EventArgs args)
        {
            var targetItem = Event.ExtractParameter(args, 0) as Item;

            if (targetItem == null)
            {
                return;
            }

            var roots = new Dictionary <string, string>();

            if (targetItem.Branch != null && targetItem.Branch.InnerItem.Children.Count == 1)
            {
                roots.Add(targetItem.Branch.InnerItem.Children[0].Paths.Path, targetItem.Paths.Path);
            }

            if (roots.Count <= 0)
            {
                return;
            }

            var refUpdater = new ReferenceUpdater(targetItem, roots, true);

            refUpdater.Start();
        }
예제 #2
0
        public new void Execute(ClientPipelineArgs args)
        {
            var targetItem = Duplicate(args);

            if (targetItem == null)
            {
                return;
            }

            if (_itemToDuplicate == null)
            {
                return;
            }

            var roots = new Dictionary <string, string>
            {
                { _itemToDuplicate.Paths.Path, targetItem.Paths.Path }
            };

            if (roots.Count <= 0)
            {
                return;
            }

            var refUpdater = new ReferenceUpdater(targetItem, roots, true);

            refUpdater.Start();
        }
        public virtual void ProcessFieldValues(CopyItemsArgs args)
        {
            var sourceRoot = GetItems(args).FirstOrDefault();

            Assert.IsNotNull(sourceRoot, "sourceRoot is null.");

            var targetItem = args.Copies.FirstOrDefault();

            Assert.IsNotNull(targetItem, "targetItem is null.");

            var roots = new Dictionary <string, string>
            {
                { sourceRoot.Paths.Path, targetItem.Paths.Path }
            };

            if (roots.Count <= 0)
            {
                return;
            }

            var refUpdater = new ReferenceUpdater(targetItem, roots, true);

            refUpdater.Start();
        }