// PUBLIC METHODS ///////////////////////////////////////////////////
        #region Factory Methods
        public static DomReadOnlyLink Create(string rel, Link link)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(link != null);

            var domReadOnlyLink = new DomReadOnlyLink(rel, link);

            return(domReadOnlyLink);
        }
Esempio n. 2
0
        // INTERNAL METHODS /////////////////////////////////////////////////
        #region Builder Methods
        internal DomReadOnlyLink AddDomReadOnlyLink(string rel, Link link)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(link != null);

            this.ValidateLinkDoesNotExist(rel);

            var domReadOnlyLink = this.CreateAndAddNode(() => DomReadOnlyLink.Create(rel, link));

            return(domReadOnlyLink);
        }
        public static DomReadOnlyLink Create(string rel, IGetLinks getLinks)
        {
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(getLinks != null && getLinks.Links != null);

            var link = getLinks.GetLink(rel);

            var domReadOnlyLink = new DomReadOnlyLink(rel, link);

            return(domReadOnlyLink);
        }