private void AddPath(IContainerElement container, GeometryBase geometry) { #region radpdfprocessing-model-path_1 Path path = container.Content.AddPath(); path.Geometry = geometry; #endregion }
private void AddImage(IContainerElement container, ImageSource imageSource) { #region radpdfprocessing-model-image_1 Image image = container.Content.AddImage(); Image imageWithSource = container.Content.AddImage(imageSource); #endregion }
public static bool TryFind <T>(this IContainerElement container, [CanBeNull] out T result) where T : IElement { var q = new Queue <IContainerElement>(); q.Enqueue(container); while (q.Count > 0) { var c = q.Dequeue(); if (c.Elements.Count == 0) { result = default; return(false); } foreach (var element in c.Elements) { if (element is T t) { result = t; return(true); } if (element is IContainerElement c2) { q.Enqueue(c2); } } } result = default; return(false); }
protected override IEnumerable <int> GetInterestingElementIds(IContainerElement element) { IMacroCommand c = element.InnerElement as IMacroCommand; yield return(c.Id); if (c.Condition != null) { yield return(c.Condition.ConditionalId); } IWaitConditionCommand wc = c as IWaitConditionCommand; if (wc != null && wc.AwaitedCondition != null) { yield return(wc.AwaitedCondition.ConditionalId); } IStartCommand sc = c as IStartCommand; if (sc != null) { yield return(sc.StartedElementId); } IStopCommand sc2 = c as IStopCommand; if (sc2 != null) { yield return(sc2.StoppedElementId); } }
private void CreateImage(IContainerElement container) { #region radpdfprocessing-model-image_0 Image image = new Image(); container.Content.Add(image); #endregion }
private void CreatePath(IContainerElement container, GeometryBase geometry) { #region radpdfprocessing-model-path_0 Path path = new Path(); path.Geometry = geometry; container.Content.Add(path); #endregion }
protected override void AddElementToGrid(IContainerElement element) { elementsGrid.Rows.Add(new object[] { element.Title, string.Empty, string.Empty, ((IChoiceElement)element).RandomChance }); }
public static T Find <T>(this IContainerElement container) where T : IElement { var b = TryFind <T>(container, out var r); if (!b) { // Similar to Enumerable.Single(). throw new InvalidOperationException(); } return(r); }
private void CreateRadFixedPage(IContainerElement container) { #region radpdfprocessing-model-textfragment_0 TextFragment fragment = new TextFragment(); container.Content.Add(fragment); #endregion #region radpdfprocessing-model-textfragment_1 TextFragment textFragment = container.Content.AddTextFragment(); TextFragment textFragmentWithText = container.Content.AddTextFragment("Text"); #endregion }
protected virtual object GetElementData(IContainerElement element) { return(null); }
protected virtual void AddElementToGrid(IContainerElement element) { }
protected virtual IEnumerable <int> GetInterestingElementIds(IContainerElement element) { yield return(element.Id); }
protected override void AddElementToGrid(IContainerElement element) { IMacroCommand c = (IMacroCommand)element.InnerElement; elementsGrid.Rows.Add(new object[] { c.DisplayDescription(m_Project), c.Condition.DisplayDescription(m_Project) }); }
protected override object GetElementData(IContainerElement element) { return(mHasMusicColumns? element.GetMusicFileInfo() : null); }
private static void BeginContainerElement(ParserContext context, IContainerElement containerElement, string[] attributeParams) { if (containerElement != null) { switch (containerElement.ContainerType) { case ContainerTypes.Division: context.Template.AddElementOpen("div", attributeParams); break; case ContainerTypes.BareList: context.Template.AddElementOpen("ul", "style", "list-style-type:none;"); break; case ContainerTypes.NumberedList: context.Template.AddElementOpen("ol", attributeParams); break; case ContainerTypes.BulletList: context.Template.AddElementOpen("ul", attributeParams); break; case ContainerTypes.BlockQuote: context.Template.AddElementOpen("blockquote", attributeParams); break; case ContainerTypes.PreFormatted: context.Template.AddElementOpen("pre", attributeParams); context.IsPreFormatted = true; break; case ContainerTypes.Table: context.Template.AddElementOpen("table", attributeParams); break; case ContainerTypes.TableHeader: context.Template.AddElementOpen("thead", attributeParams); break; case ContainerTypes.TableBody: context.Template.AddElementOpen("tbody", attributeParams); break; case ContainerTypes.TableFooter: context.Template.AddElementOpen("tfoot", attributeParams); break; case ContainerTypes.TableHeaderRow: case ContainerTypes.TableFooterRow: case ContainerTypes.TableDataRow: context.Template.AddElementOpen("tr", attributeParams); break; case ContainerTypes.TableDataCell: context.Template.AddElementOpen("td", attributeParams); break; default: throw new Exception("Document parser does not know how to write " + containerElement.ContainerType + " containers"); } } }
protected override void AddElementToGrid(IContainerElement element) { ISequentialElement e = (ISequentialElement)element; elementsGrid.Rows.Add(new object[] { e.Title, string.Empty, string.Empty, e.FixedStartDelay.TotalMilliseconds, e.MaximumRandomStartDelay.TotalMilliseconds }); }
public static T FindOrNull <T>(this IContainerElement container) where T : class, IElement { var b = TryFind <T>(container, out var r); return(b ? r : null); }
protected override void AddElementToGrid(IContainerElement element) { elementsGrid.Rows.Add(new object[] { element.Title }); }