Esempio n. 1
0
        private void CreateTitle(System.Web.UI.HtmlControls.HtmlTableCell Parent)
        {
            System.Web.UI.HtmlControls.HtmlGenericControl titleText = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            titleText.Attributes["class"] = "titleText";
            System.Web.UI.HtmlControls.HtmlGenericControl close = new System.Web.UI.HtmlControls.HtmlGenericControl("div");
            close.Attributes["class"] = "close";

            Parent.Controls.Add(titleText);
            if (TitleTemplate == null)
            {
                if (Text == "")
                {
                    titleText.InnerHtml = "untitled";
                }
                else
                {
                    titleText.InnerHtml = Text;
                }
            }
            else
            {
                TitleTemplate.InstantiateIn(titleText);
            }


            if (Closable)
            {
                Parent.Controls.Add(close);
            }
        }
Esempio n. 2
0
        private ViewButton CreateTitle(ITabItem tabItem)
        {
            View title    = null;
            var  selector = TitleTemplate as DataTemplateSelector;

            if (selector != null)
            {
                var template = selector.SelectTemplate(tabItem, this);
                title = template?.CreateContent() as View;
            }
            else
            {
                title = (View)TitleTemplate.CreateContent();
            }
            if (title == null)
            {
                throw new InvalidOperationException(
                          "Could not instantiate title. Please make sure that your TitleTemplate is configured correctly.");
            }

            title.BindingContext = tabItem;
            var button = new ViewButton()
            {
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            button.Content  = title;
            button.Clicked += ViewButtonOnClicked;
            return(button);
        }
Esempio n. 3
0
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);

        uxTitlePlaceHolder.Controls.Clear();
        uxContentPlaceHolder.Controls.Clear();

        ContentContainer container = new ContentContainer();

        if (TitleTemplate != null)
        {
            TitleTemplate.InstantiateIn(container);
            uxTitlePlaceHolder.Controls.Add(container);
        }
        else
        {
            uxTitlePlaceHolder.Visible = false;
        }

        container = new ContentContainer();
        if (ContentTemplate != null)
        {
            ContentTemplate.InstantiateIn(container);
            uxContentPlaceHolder.Controls.Add(container);
        }
        else
        {
            uxContentPanel.CssClass = "Clear";
        }
    }
Esempio n. 4
0
        /// <summary>
        /// Publish the <see cref="AddAssetToTimelineEvent"/> to add the asset in the timeline at the current playhead position.
        /// </summary>
        /// <param name="titleTemplate">Title template of the title asset to be added to timeline.</param>
        public void AddTitleAssetToTimeline(TitleTemplate titleTemplate)
        {
            TitleAsset titleAsset = CreateTitleAsset(titleTemplate);

            if (titleTemplate != null)
            {
                this.eventAggregator.GetEvent <AddAssetToTimelineEvent>().Publish(titleAsset);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Notifies the model that a new title should be added to the timeline.
        /// </summary>
        private void AddTitleToTimeline()
        {
            TitleTemplate selectedTitleTemplate = this.TitleList.SelectedItem as TitleTemplate;

            if (selectedTitleTemplate != null)
            {
                this.Model.AddTitleAssetToTimeline(selectedTitleTemplate);
            }
        }
        /// <summary>
        /// Creates a title template for testing.
        /// </summary>
        /// <returns>A title template with values.</returns>
        private static TitleTemplate CreateTitleTemplate()
        {
            var titleTemplate = new TitleTemplate();

            titleTemplate.Id           = CreateUri();
            titleTemplate.TemplateName = "Spinner";
            titleTemplate.Creator      = "Creator";
            titleTemplate.Created      = new DateTime(2009, 1, 1);

            return(titleTemplate);
        }
Esempio n. 7
0
        /// <summary>
        /// Called when title XAML been downloaded.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="args">The <see cref="DownloadStringCompletedEventArgs"/> instance containing the event data.</param>
        private void OnClientOnDownloadStringCompleted(object sender, DownloadStringCompletedEventArgs args)
        {
            TitleTemplate template = args.UserState as TitleTemplate;

            if (args.Error == null && template != null)
            {
                template.MainText     = this.MainTitle;
                template.SubText      = this.SubTitle;
                template.XamlResource = args.Result;
                this.TitleTemplates.Add(template);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Creates a <see cref="TitleAsset"/> associated to the <see cref="TitleTemplate"/> passed.
        /// </summary>
        /// <param name="titleTemplate">The title template of the title asset being created.</param>
        /// <returns>A new title asset.</returns>
        private static TitleAsset CreateTitleAsset(TitleTemplate titleTemplate)
        {
            TitleAsset titleAsset = new TitleAsset
            {
                Title         = titleTemplate.Title,
                MainText      = titleTemplate.MainText,
                SubText       = titleTemplate.SubText,
                TitleTemplate = titleTemplate
            };

            return(titleAsset);
        }
Esempio n. 9
0
        protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
        {
            base.PrepareContainerForItemOverride(element, item);
            var tgv_item = (TreeGridViewItem)element;

            if (TitleTemplateSelector != null)
            {
                tgv_item.TitleTemplate = TitleTemplateSelector.SelectTemplate(item, element);
            }
            else if (TitleTemplate != null)
            {
                tgv_item.Title = TitleTemplate.LoadContent();
            }
        }
Esempio n. 10
0
        protected override void CreateChildControls()
        {
            phTitle.Controls.Clear();
            LearnMoreContainer lmcTitle = new LearnMoreContainer();

            TitleTemplate.InstantiateIn(lmcTitle);
            phTitle.Controls.Add(lmcTitle);

            phText.Controls.Clear();
            LearnMoreContainer lmcText = new LearnMoreContainer();

            TextTemplate.InstantiateIn(lmcText);
            phText.Controls.Add(lmcText);

            base.CreateChildControls();
        }
        public void ShouldPublishAddAssetToTimelineEvent()
        {
            var titleTemplate = new TitleTemplate
            {
                MainText = "MainText",
                SubText  = "SubText"
            };

            var presentationModel = this.CreatePresentationModel();

            Assert.IsFalse(this.addAssetToTimelineEvent.PublishCalled);

            presentationModel.AddTitleAssetToTimeline(titleTemplate);

            Assert.IsTrue(this.addAssetToTimelineEvent.PublishCalled);
            Assert.IsInstanceOfType(this.addAssetToTimelineEvent.Asset, typeof(TitleAsset));
            Assert.AreSame(titleTemplate, ((TitleAsset)this.addAssetToTimelineEvent.Asset).TitleTemplate);
        }
        public void ShouldDownloadXamlResourceAndAddTheTitleTemplateOnCollection()
        {
            var titleTemplate = new TitleTemplate {
                Title = "Test"
            };

            this.configurationService.GetParameterValueReturnFunction = parameter => parameter == "TitleTemplates" ? "Test|http://test" : null;

            this.downloader.Result    = "<canvas></canvas>";
            this.downloader.UserState = titleTemplate;

            this.serviceFacade.TitleTemplates = new List <TitleTemplate> {
                titleTemplate
            };

            var presentationModel = this.CreatePresentationModel();

            Assert.AreEqual(1, presentationModel.TitleTemplates.Count);
            Assert.AreEqual(this.downloader.Result, titleTemplate.XamlResource);
        }
Esempio n. 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TitlePlayer"/> class.
        /// </summary>
        /// <param name="asset">The asset.</param>
        public TitlePlayer(TitleAsset asset)
        {
            this.DataContext = asset;

            Canvas.SetZIndex(this, 5);

            if (asset.TitleTemplate.XamlResource == null)
            {
                IConfigurationService configurationService = ServiceLocator.Current.GetInstance(typeof(IConfigurationService)) as IConfigurationService;

                if (configurationService != null)
                {
                    Downloader downloader = ServiceLocator.Current.GetInstance(typeof(Downloader)) as Downloader;

                    if (downloader != null)
                    {
                        Uri xamlResource = configurationService.GetTitleTemplate(asset.TitleTemplate.Title);
                        downloader.DownloadStringCompleted += (sender, e) =>
                        {
                            TitleTemplate template =
                                e.UserState as TitleTemplate;
                            if (e.Error == null && template != null)
                            {
                                template.XamlResource = e.Result;
                                this.LoadTitle(template.XamlResource);
                            }
                        };
                        downloader.DownloadStringAsync(xamlResource, asset.TitleTemplate);
                    }
                }
            }
            else
            {
                this.LoadTitle(asset.TitleTemplate.XamlResource);
            }

            this.timer            = new Storyboard();
            this.timer.Completed += this.Timer_Completed;
        }
Esempio n. 14
0
        /// <summary>
        /// Creates the title.
        /// </summary>
        /// <param name="titleTemplate">The <see cref="TitleTemplate"/>.</param>
        /// <param name="position">The position of the title in the timeline.</param>
        /// <param name="markOut">The mark out time.</param>
        /// <returns>The <see cref="Title"/>.</returns>
        private static Title CreateTitle(TitleTemplate titleTemplate, double position, double markOut)
        {
            return(new Title
            {
                Id = CreateUri(Titles),
                TitleTemplate = titleTemplate,
                TrackAnchor = new Anchor {
                    MarkIn = position, MarkOut = markOut
                },
                TextBlockCollection =
                {
                    new TextBlock
                    {
                        Text = "Main Test"
                    },

                    new TextBlock
                    {
                        Text = "Sub Title Test"
                    }
                }
            });
        }
Esempio n. 15
0
        /// <summary>
        /// Creates the title.
        /// </summary>
        /// <param name="titleTemplate">The <see cref="TitleTemplate"/>.</param>
        /// <param name="position">The position of the title in the timeline.</param>
        /// <param name="markOut">The mark out time.</param>
        /// <returns>The <see cref="Title"/>.</returns>
        private static Title CreateTitle(TitleTemplate titleTemplate, double position, double markOut)
        {
            return(new Title
            {
                Id = CreateUri(Titles),
                TitleTemplate = titleTemplate,
                TrackAnchor = new Anchor {
                    MarkIn = position, MarkOut = markOut
                },
                TextBlockCollection =
                {
                    new TextBlock
                    {
                        Text = RCE.Data.Demo.Properties.Resources.TitleText
                    },

                    new TextBlock
                    {
                        Text = RCE.Data.Demo.Properties.Resources.SubtitleText
                    }
                }
            });
        }
Esempio n. 16
0
 public void OnDropItem(TitleTemplate titleAsset, MouseButtonEventArgs e)
 {
     throw new System.NotImplementedException();
 }
Esempio n. 17
0
 public void AddTitleAssetToTimeline(TitleTemplate titleTemplate)
 {
     throw new System.NotImplementedException();
 }
 /// <summary>
 /// Asserts that the <paramref name="sqlTitleTemplate"/> contains equivalent values from the <paramref name="titleTemplate"/>.
 /// </summary>
 /// <param name="titleTemplate">The title template with expected values.</param>
 /// <param name="sqlTitleTemplate">The title template with actual values.</param>
 public static void AssertTitleTemplate(TitleTemplate titleTemplate, SqlTitleTemplate sqlTitleTemplate)
 {
     Assert.AreEqual(titleTemplate.Id.ToString(), string.Format(IdUrlTemplate, sqlTitleTemplate.Id));
     Assert.AreEqual(titleTemplate.TemplateName, sqlTitleTemplate.TemplateName);
 }
Esempio n. 19
0
        protected override void RenderContent(String innerText, String rawInnerText)
        {
            var dataSource = ItemsSource as IEnumerable;
            var innerTable = new TableControl();

            innerTable.DataContext = dataSource;
            innerTable.Children.Clear();
            innerTable.HeaderRows.Clear();
            innerTable.FooterRows.Clear();

            if (dataSource != null && dataSource.GetEnumerator().MoveNext())
            {
                if (TitleVisibility != Visibility.None && TitleTemplate != null)
                {
                    innerTable.NewHeaderRow().Add(TitleTemplate
                                                  .SetColSpan(_columns.Count)
                                                  .SetProperty(HtmlControl.VisibilityProperty, TitleVisibility));
                }

                if (HeaderVisibility != Visibility.None)
                {
                    var             rows     = CreateRowSchema <TableHeaderCell>((col) => col.HeaderTemplate);
                    TableHeaderCell firstCol = null;
                    foreach (var rowSchema in rows)
                    {
                        var tableRow = innerTable.NewHeaderRow();
                        tableRow.Children.AddRange(rowSchema);
                        if (tableRow.Count > 0)
                        {
                            firstCol = tableRow[0];
                        }
                    }
                    if (firstCol != null)
                    {
                        firstCol.AddClass("first");
                    }
                }

                //criar o esquema das linhas e colunas da tabela
                var itemRowSchema = CreateRowSchema((col) => col.ItemTemplate);

                //por fim fazer um loop no datasource, considerando a paginação e renderizando as linhas
                var firstRow = true;
                foreach (var item in dataSource)
                {
                    foreach (var rowSchema in itemRowSchema)
                    {
                        var tableRow = innerTable.NewRow();
                        //renderiazar a linha.
                        if (firstRow)
                        {
                            tableRow.AddClass("first");
                            firstRow = false;
                        }
                        tableRow.DataContext = item;
                        tableRow.Children.AddRange(rowSchema);
                    }
                }

                if (FooterVisibility != Visibility.None && _hasFooterCells)
                {
                    var             hrow  = new TableHeaderRow();
                    TableHeaderCell first = null;
                    foreach (var column in _columns)
                    {
                        if (column.ColSpanBehavior == ColSpanBehavior.NoSpan)
                        {
                            hrow.Add(column.FooterTemplate);
                            first = first ?? column.FooterTemplate;
                        }
                    }
                    if (first != null)
                    {
                        first.AddClass("first");
                    }
                    innerTable.FooterRows.Add(hrow);
                }
            }
            else if (EmptySourceTemplate != null)
            {
                innerTable.NewCell()
                .SetColSpan(Columns.Count)
                .Add(EmptySourceTemplate);
            }

            innerTable.Render(CurrentContext);
            base.RenderContent("", rawInnerText);
        }
Esempio n. 20
0
        public override bool Equals(object o)
        {
            if (!(o is ConversionProfile))
            {
                return(false);
            }
            var v = o as ConversionProfile;

            if (!AttachmentPage.Equals(v.AttachmentPage))
            {
                return(false);
            }
            if (!AutoSave.Equals(v.AutoSave))
            {
                return(false);
            }
            if (!BackgroundPage.Equals(v.BackgroundPage))
            {
                return(false);
            }
            if (!CoverPage.Equals(v.CoverPage))
            {
                return(false);
            }
            if (!EmailClient.Equals(v.EmailClient))
            {
                return(false);
            }
            if (!EmailSmtp.Equals(v.EmailSmtp))
            {
                return(false);
            }
            if (!Ftp.Equals(v.Ftp))
            {
                return(false);
            }
            if (!Ghostscript.Equals(v.Ghostscript))
            {
                return(false);
            }
            if (!JpegSettings.Equals(v.JpegSettings))
            {
                return(false);
            }
            if (!PdfSettings.Equals(v.PdfSettings))
            {
                return(false);
            }
            if (!PngSettings.Equals(v.PngSettings))
            {
                return(false);
            }
            if (!Printing.Equals(v.Printing))
            {
                return(false);
            }
            if (!Properties.Equals(v.Properties))
            {
                return(false);
            }
            if (!SaveDialog.Equals(v.SaveDialog))
            {
                return(false);
            }
            if (!Scripting.Equals(v.Scripting))
            {
                return(false);
            }
            if (!Stamping.Equals(v.Stamping))
            {
                return(false);
            }
            if (!TiffSettings.Equals(v.TiffSettings))
            {
                return(false);
            }
            if (!AuthorTemplate.Equals(v.AuthorTemplate))
            {
                return(false);
            }
            if (!FileNameTemplate.Equals(v.FileNameTemplate))
            {
                return(false);
            }
            if (!Guid.Equals(v.Guid))
            {
                return(false);
            }
            if (!Name.Equals(v.Name))
            {
                return(false);
            }
            if (!OpenViewer.Equals(v.OpenViewer))
            {
                return(false);
            }
            if (!OutputFormat.Equals(v.OutputFormat))
            {
                return(false);
            }
            if (!ShowProgress.Equals(v.ShowProgress))
            {
                return(false);
            }
            if (!SkipPrintDialog.Equals(v.SkipPrintDialog))
            {
                return(false);
            }
            if (!TitleTemplate.Equals(v.TitleTemplate))
            {
                return(false);
            }
            if (!ServerSetting.Equals(v.ServerSetting))
            {
                return(false);
            }

            return(true);
        }