示例#1
0
        public MissingTarget NewMissingTarget()
        {
            if (Parent == null)
            {
                throw new InvalidOperationException();
            }
            Uri collUrl    = DestinationUrl.GetParent();
            var collTarget = CollectionTarget.NewInstance(collUrl, Parent, _targetActions);

            return(new MissingTarget(DestinationUrl, Name, collTarget, _targetActions));
        }
示例#2
0
        public CollectionTarget NewCollectionTarget()
        {
            if (Collection == null)
            {
                throw new InvalidOperationException();
            }
            Uri collUrl    = DestinationUrl.GetParent();
            var collTarget = Parent == null ? null : CollectionTarget.NewInstance(collUrl, Parent, _targetActions);

            return(new CollectionTarget(DestinationUrl, collTarget, Collection, false, _targetActions));
        }
示例#3
0
        public DocumentTarget NewDocumentTarget()
        {
            if (Document == null || Parent == null)
            {
                throw new InvalidOperationException();
            }
            Uri collUrl    = DestinationUrl.GetParent();
            var collTarget = CollectionTarget.NewInstance(collUrl, Parent, _targetActions);

            return(new DocumentTarget(collTarget, DestinationUrl, Document, _targetActions));
        }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntryTarget"/> class.
 /// </summary>
 /// <param name="targetActions">The target actions implementation to use</param>
 /// <param name="parent">The parent collection</param>
 /// <param name="destinationUrl">The destination URL for this entry</param>
 /// <param name="entry">The underlying entry</param>
 protected EntryTarget(
     ITargetActions <CollectionTarget, DocumentTarget, MissingTarget> targetActions,
     [CanBeNull] CollectionTarget parent,
     [NotNull] Uri destinationUrl,
     [NotNull] IEntry entry)
 {
     TargetActions  = targetActions;
     _entry         = entry;
     Name           = entry.Name;
     Parent         = parent;
     DestinationUrl = destinationUrl;
 }