public ManifestPageGenerator(ITemplateGenerator templateGenerator, IPageDefinition pageDefinitionService, IFr8Account fr8AccountService, IUnitOfWorkFactory uowFactory)
 {
     _templateGenerator     = templateGenerator;
     _pageDefinitionService = pageDefinitionService;
     _fr8AccountService     = fr8AccountService;
     _uowFactory            = uowFactory;
 }
Exemplo n.º 2
0
 public Page(IPageDefinition original, ElementCollection elements, int pageNumber)
     : this(
         original.Document, original.Key, original.Width.ToString(), original.Height.ToString(),
         original.ColorType, original.Bleeding.ToString(), pageNumber)
 {
     _contents = new Content(this, elements);
 }
Exemplo n.º 3
0
        ///<summary>
        ///</summary>
        ///<param name="paragraph"></param>
        ///<param name="text"></param>
        ///<param name="font"></param>
        ///<param name="fontsize"></param>
        ///<param name="color"></param>
        public TextElement(Paragraph paragraph, string text, FontStyle font, Unit fontsize, Color color)
        {
            _page      = paragraph.Page;
            _paragraph = paragraph;
            _text      = text;

            _fontStyle = font;
            _color     = color;
            _fontSize  = fontsize;
        }
 public WebservicesPageGenerator(
     IPageDefinition pageDefinitionService,
     IPlanTemplate planTemplateService,
     ITemplateGenerator templateGenerator,
     ITagGenerator tagGenerator)
 {
     _pageDefinitionService = pageDefinitionService;
     _planTemplateService   = planTemplateService;
     _templateGenerator     = templateGenerator;
     _tagGenerator          = tagGenerator;
 }
Exemplo n.º 5
0
        ///<summary>
        ///</summary>
        ///<param name="paragraph"></param>
        ///<param name="text"></param>
        ///<param name="font"></param>
        ///<param name="style"></param>
        ///<param name="fontsize"></param>
        ///<param name="color"></param>
        ///<exception cref="ArgumentException"></exception>
        public TextElement(Paragraph paragraph, string text, string font, string style, string fontsize, string color)
        {
            _page = paragraph.Page;

            _paragraph = paragraph;
            _text      = text;
            _fontStyle = _page.Document.Fonts[font].Styles[style];
            _color     = _page.Document.Colors[color];


            _fontSize = new Unit(fontsize);

            if (_fontSize.Points <= 0)
            {
                throw new ArgumentException("Fontsize should be larger than zero.", "fontsize");
            }
        }
 private void Add(IPageDefinition pageDefinition)
 {
     Set(ContentClasses, PageDefinitions.Union(new[] { pageDefinition }));
 }
 private void Remove(IPageDefinition pageDefinition)
 {
     Set(ContentClasses, PageDefinitions.Except(new[] { pageDefinition }));
 }
Exemplo n.º 8
0
        public void Configure(IPageDefinition page, AttributeSet attributes)
        {
            if (ReferenceEquals(page, null))
            {
                return;
            }

            var validationErrros = _attributeMatrix.Validate <IPageDefinition>(attributes);

            if (validationErrros != null)
            {
                var message = "There are invalid attributes on page of type " + page.GetType().DisplayName();

                if (attributes.IsPage != null && string.IsNullOrEmpty(attributes.IsPage.Name))
                {
                    message += " called '" + attributes.IsPage.Name + "'.";
                }

                foreach (var error in validationErrros)
                {
                    message += Environment.NewLine + error;
                }

                throw new PageBuilderException(message);
            }

            if (!ReferenceEquals(attributes.IsPage, null))
            {
                page.Name(attributes.IsPage.Name);
                page.CanonicalUrl(attributes.IsPage.CanonicalUrl);
            }

            if (!ReferenceEquals(attributes.NeedsDatas, null))
            {
                foreach (var dataNeed in attributes.NeedsDatas)
                {
                    if (!string.IsNullOrEmpty(dataNeed.DataProviderName))
                    {
                        page.DataProvider(dataNeed.DataProviderName);
                    }
                    if (dataNeed.DataType != null)
                    {
                        page.BindTo(dataNeed.DataType, dataNeed.Scope);
                    }
                }
            }

            if (!ReferenceEquals(attributes.PartOf, null))
            {
                page.PartOf(attributes.PartOf.PackageName);
            }

            if (!ReferenceEquals(attributes.DeployedAs, null))
            {
                page
                .DeployIn(attributes.DeployedAs.ModuleName)
                .AssetDeployment(attributes.DeployedAs.Deployment);
            }

            if (!ReferenceEquals(attributes.NeedsComponents, null))
            {
                foreach (var need in attributes.NeedsComponents)
                {
                    page.NeedsComponent(need.ComponentName);
                }
            }

            if (!ReferenceEquals(attributes.RegionComponents, null))
            {
                foreach (var regionComponent in attributes.RegionComponents)
                {
                    page.RegionComponent(regionComponent.Region, regionComponent.Component);
                }
            }

            if (!ReferenceEquals(attributes.RegionLayouts, null))
            {
                foreach (var regionLayout in attributes.RegionLayouts)
                {
                    page.RegionLayout(regionLayout.Region, regionLayout.Layout);
                }
            }

            if (!ReferenceEquals(attributes.PageTitle, null))
            {
                page.Title(attributes.PageTitle.Title);
            }

            if (!ReferenceEquals(attributes.Style, null))
            {
                page.BodyStyle(attributes.Style.CssStyle);
            }

            if (!ReferenceEquals(attributes.UsesLayout, null))
            {
                page.Layout(attributes.UsesLayout.LayoutName);
            }

            if (!ReferenceEquals(attributes.Routes, null))
            {
                foreach (var route in attributes.Routes)
                {
                    page.Route(route.Path, route.Priority, route.Methods);
                }
            }

            if (!ReferenceEquals(attributes.DataScopes, null))
            {
                foreach (var dataScope in attributes.DataScopes)
                {
                    page.DataScope(dataScope.DataType, dataScope.Scope);
                }
            }
        }
Exemplo n.º 9
0
 public PageDefinitionsController()
 {
     _pageDefinition           = ObjectFactory.GetInstance <IPageDefinition>();
     _securityServices         = ObjectFactory.GetInstance <ISecurityServices>();
     _webServicesPageGenerator = ObjectFactory.GetInstance <IWebservicesPageGenerator>();
 }
Exemplo n.º 10
0
		///	<summary> 
		///		This method copy's each database field which is in the <paramref name="includedColumns"/> 
		///		from the <paramref name="source"/> interface to this data row.
		/// </summary>
		public void Copy_From_But_TakeOnly(IPageDefinition source, params string[] includedColumns)
		{
			if (includedColumns.Contains(PageDefinitionsTable.IdCol)) this.Id = source.Id;
			if (includedColumns.Contains(PageDefinitionsTable.NameIdCol)) this.NameId = source.NameId;
			if (includedColumns.Contains(PageDefinitionsTable.PageNameCol)) this.PageName = source.PageName;
			if (includedColumns.Contains(PageDefinitionsTable.TableIdCol)) this.TableId = source.TableId;
			if (includedColumns.Contains(PageDefinitionsTable.DependentOnItemCol)) this.DependentOnItem = source.DependentOnItem;
			if (includedColumns.Contains(PageDefinitionsTable.PagePlayingOrderCol)) this.PagePlayingOrder = source.PagePlayingOrder;
		}
Exemplo n.º 11
0
		///	<summary> This method copy's each database field from the <paramref name="source"/> interface to this data row.</summary>
		public void Copy_From(IPageDefinition source, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) this.Id = source.Id;
			this.NameId = source.NameId;
			this.PageName = source.PageName;
			this.TableId = source.TableId;
			this.DependentOnItem = source.DependentOnItem;
			this.PagePlayingOrder = source.PagePlayingOrder;
		}
Exemplo n.º 12
0
		///	<summary> This method copy's each database field into the <paramref name="target"/> interface. </summary>
		public void Copy_To(IPageDefinition target, bool includePrimaryKey = false)
		{
			if (includePrimaryKey) target.Id = this.Id;
			target.NameId = this.NameId;
			target.PageName = this.PageName;
			target.TableId = this.TableId;
			target.DependentOnItem = this.DependentOnItem;
			target.PagePlayingOrder = this.PagePlayingOrder;
		}