public IPrimaryResourceBuilder <TResource> Resource <TResource>(TResource clrResource)
            where TResource : class, IResource
        {
            var primaryResourceBuilder = new PrimaryResourceBuilder <TResource>(this, this.DomDocument, clrResource);

            return(primaryResourceBuilder);
        }
Пример #2
0
        // Resource /////////////////////////////////////////////////////////
        #region Generic Versions
        public IPrimaryResourceBuilder <TResource> Resource <TResource>()
            where TResource : class
        {
            var primaryResourceBuilder = new PrimaryResourceBuilder <TResource>(this, this.DomDocument, null);

            return(primaryResourceBuilder);
        }
Пример #3
0
        public IPrimaryResourceBuilder Resource(Type clrResourceType)
        {
            Contract.Requires(clrResourceType != null);

            var primaryResourceBuilder = new PrimaryResourceBuilder(this, this.DomDocument, clrResourceType, null);

            return(primaryResourceBuilder);
        }
        public IPrimaryResourceBuilder <TResource> Resource <TResource>(IResourceSource <TResource> resourceSource)
            where TResource : class, IResource
        {
            Contract.Requires(resourceSource != null);

            var clrResource = resourceSource.GetResource();

            var primaryResourceBuilder = new PrimaryResourceBuilder <TResource>(this, this.DomDocument, clrResource);

            return(primaryResourceBuilder);
        }
Пример #5
0
        public IPrimaryResourceBuilder Resource(object clrResource)
        {
            if (clrResource == null)
            {
                const string message = "CLR resource can not be null, use the other Resource method that takes the CLR resource type as a single parameter instead.";
                throw new ArgumentNullException(nameof(clrResource), message);
            }

            var clrResourceType        = clrResource.GetType();
            var primaryResourceBuilder = new PrimaryResourceBuilder(this, this.DomDocument, clrResourceType, clrResource);

            return(primaryResourceBuilder);
        }