internal IRIFDataScope RegisterCell(IRIFDataScope cell) { if (!m_scopes.TryGetValue(cell, out ScopeTreeNode value)) { if (HasScope(m_activeRowScopes) && HasScope(m_activeColumnScopes)) { ScopeTreeNode first = m_activeRowScopes.First; ScopeTreeNode first2 = m_activeColumnScopes.First; if (!TryGetCanonicalCellScope(first, first2, out value)) { value = new IntersectScopeNode(cell, first, first2); AddCanonicalCellScope(first, first2, value); } ((IntersectScopeNode)value).AddCell(cell); } else { value = new SubScopeNode(cell, m_activeScopes.First); } } AddScope(value, cell); m_activeRowScopes = m_activeRowScopes.Add(null); m_activeColumnScopes = m_activeColumnScopes.Add(null); return(value.Scope); }
public void UnRegisterDataRegion(AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion) { this.m_activeScopes = this.m_activeScopes.Rest; this.m_activeRowScopes = this.m_activeRowScopes.Rest; this.m_activeColumnScopes = this.m_activeColumnScopes.Rest; this.m_dataRegionScopes = this.m_dataRegionScopes.Rest; }
internal void UnRegisterDataRegion(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion) { m_activeScopes = m_activeScopes.Rest; m_activeRowScopes = m_activeRowScopes.Rest; m_activeColumnScopes = m_activeColumnScopes.Rest; m_dataRegionScopes = m_dataRegionScopes.Rest; }
public IRIFDataScope RegisterCell(IRIFDataScope cell) { ScopeTreeNode scopeTreeNode = default(ScopeTreeNode); if (!this.m_scopes.TryGetValue(cell, out scopeTreeNode)) { if (this.HasScope(this.m_activeRowScopes) && this.HasScope(this.m_activeColumnScopes)) { ScopeTreeNode first = this.m_activeRowScopes.First; ScopeTreeNode first2 = this.m_activeColumnScopes.First; if (!this.TryGetCanonicalCellScope(first, first2, out scopeTreeNode)) { scopeTreeNode = new IntersectScopeNode(cell, first, first2); this.AddCanonicalCellScope(first, first2, scopeTreeNode); } ((IntersectScopeNode)scopeTreeNode).AddCell(cell); } else { scopeTreeNode = new SubScopeNode(cell, this.m_activeScopes.First); } } this.AddScope(scopeTreeNode, cell); this.m_activeRowScopes = this.m_activeRowScopes.Add(null); this.m_activeColumnScopes = this.m_activeColumnScopes.Add(null); return(scopeTreeNode.Scope); }
private bool HasScope(FunctionalList <ScopeTreeNode> list) { if (!list.IsEmpty()) { return(list.First != null); } return(false); }
private void AddScope(ScopeTreeNode scopeNode, IRIFDataScope scope) { m_activeScopes = m_activeScopes.Add(scopeNode); m_scopes[scope] = scopeNode; if (!string.IsNullOrEmpty(scopeNode.ScopeName)) { m_scopesByName[scopeNode.ScopeName] = scopeNode; } }
internal ScopeTree() { m_scopes = new Dictionary <IRIFDataScope, ScopeTreeNode>(); m_scopesByName = new Dictionary <string, ScopeTreeNode>(StringComparer.Ordinal); m_dataRegionScopes = FunctionalList <ScopeTreeNode> .Empty; m_activeScopes = FunctionalList <ScopeTreeNode> .Empty; m_activeRowScopes = FunctionalList <ScopeTreeNode> .Empty; m_activeColumnScopes = FunctionalList <ScopeTreeNode> .Empty; m_canonicalCellScopes = new Dictionary <string, Dictionary <string, ScopeTreeNode> >(); }
internal void RegisterDataRegion(Microsoft.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion) { if (!m_scopes.TryGetValue(dataRegion, out ScopeTreeNode value)) { value = new SubScopeNode(dataRegion, m_activeScopes.First); } AddScope(value); m_dataRegionScopes = m_dataRegionScopes.Add(value); m_activeRowScopes = m_activeRowScopes.Add(null); m_activeColumnScopes = m_activeColumnScopes.Add(null); }
public void RegisterDataRegion(AspNetCore.ReportingServices.ReportIntermediateFormat.DataRegion dataRegion) { ScopeTreeNode scopeTreeNode = default(ScopeTreeNode); if (!this.m_scopes.TryGetValue((IRIFDataScope)dataRegion, out scopeTreeNode)) { scopeTreeNode = new SubScopeNode(dataRegion, this.m_activeScopes.First); } this.AddScope(scopeTreeNode); this.m_dataRegionScopes = this.m_dataRegionScopes.Add(scopeTreeNode); this.m_activeRowScopes = this.m_activeRowScopes.Add(null); this.m_activeColumnScopes = this.m_activeColumnScopes.Add(null); }
public static void Run() { Supplies.Init(500, 1000, 1000, 100, 500, 100, 100, 10, 200, 300); var programTimer = new ProgramTimer(); programTimer.Start(); Counter.Enter(); do { switch (_enterCode) { case 1: _enterCode = 1; Counter.Enter(); break; case 2: _enterCode = 2; WaitingList.Enter(); break; case 3: _enterCode = 3; FunctionalList.Enter(); break; case 4: _enterCode = 4; Supplies.Enter(); break; case 6: _enterCode = 6; CoffeeMachine.Enter(); break; case 7: _enterCode = 7; Oven.Enter(); break; } } while (true); }
internal void UnRegisterCell(IRIFDataScope cell) { m_activeScopes = m_activeScopes.Rest; m_activeRowScopes = m_activeRowScopes.Rest; m_activeColumnScopes = m_activeColumnScopes.Rest; }
private void ParseParagraphElement(HtmlElement.HtmlElementType elementType, FunctionalList <ListStyle> listStyles) { this.CloseParagraph(); if (base.m_currentParagraph.ElementType == HtmlElement.HtmlElementType.P) { base.m_currentParagraph = base.m_currentParagraph.RemoveParagraph(HtmlElement.HtmlElementType.P); base.m_currentStyle = base.m_currentStyle.RemoveStyle(HtmlElement.HtmlElementType.P); } if (elementType == HtmlElement.HtmlElementType.LI) { this.FlushPendingLI(); if (listStyles.Count > 0) { base.m_currentParagraph.ListStyle = listStyles.First; } else { base.m_currentParagraph.ListStyle = ListStyle.Bulleted; } } else { base.m_currentStyle = base.m_currentStyle.CreateChildStyle(elementType); base.m_currentParagraph = base.m_currentParagraph.CreateChildParagraph(elementType); switch (elementType) { case HtmlElement.HtmlElementType.H1: base.m_currentStyle.FontSize = StyleDefaults.H1FontSize; base.m_currentStyle.FontWeight = FontWeights.Bold; this.SetMarginTopAndBottom(StyleDefaults.H1Margin); break; case HtmlElement.HtmlElementType.H2: base.m_currentStyle.FontSize = StyleDefaults.H2FontSize; base.m_currentStyle.FontWeight = FontWeights.Bold; this.SetMarginTopAndBottom(StyleDefaults.H2Margin); break; case HtmlElement.HtmlElementType.H3: base.m_currentStyle.FontSize = StyleDefaults.H3FontSize; base.m_currentStyle.FontWeight = FontWeights.Bold; this.SetMarginTopAndBottom(StyleDefaults.H3Margin); break; case HtmlElement.HtmlElementType.H4: base.m_currentStyle.FontSize = StyleDefaults.H4FontSize; base.m_currentStyle.FontWeight = FontWeights.Bold; this.SetMarginTopAndBottom(StyleDefaults.H4Margin); break; case HtmlElement.HtmlElementType.H5: base.m_currentStyle.FontSize = StyleDefaults.H5FontSize; base.m_currentStyle.FontWeight = FontWeights.Bold; this.SetMarginTopAndBottom(StyleDefaults.H5Margin); break; case HtmlElement.HtmlElementType.H6: base.m_currentStyle.FontSize = StyleDefaults.H6FontSize; base.m_currentStyle.FontWeight = FontWeights.Bold; this.SetMarginTopAndBottom(StyleDefaults.H6Margin); break; case HtmlElement.HtmlElementType.P: this.SetMarginTopAndBottom(StyleDefaults.PMargin); break; } string text = default(string); if (!this.m_currentHtmlElement.IsEmptyElement && this.m_currentHtmlElement.HasAttributes && base.m_allowMultipleParagraphs && this.m_currentHtmlElement.Attributes.TryGetValue("align", out text)) { TextAlignments textAlign = default(TextAlignments); if (RichTextStyleTranslator.TranslateTextAlign(text, out textAlign)) { base.m_currentStyle.TextAlign = textAlign; } else { base.m_richTextLogger.RegisterInvalidValueWarning("align", text, this.m_currentHtmlElement.CharacterPosition); } } } this.SetStyleValues(true); }
private void AddGroupScope(Microsoft.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode member, ref FunctionalList <ScopeTreeNode> axisScopes) { if (!m_scopes.TryGetValue(member, out ScopeTreeNode value)) { value = (HasScope(axisScopes) ? new SubScopeNode(member, m_activeScopes.First) : new SubScopeNode(member, m_dataRegionScopes.First)); } AddScope(value); axisScopes = axisScopes.Add(value); }
public void UnRegisterCell(IRIFDataScope cell) { this.m_activeScopes = this.m_activeScopes.Rest; this.m_activeRowScopes = this.m_activeRowScopes.Rest; this.m_activeColumnScopes = this.m_activeColumnScopes.Rest; }
private void AddGroupScope(AspNetCore.ReportingServices.ReportIntermediateFormat.ReportHierarchyNode member, ref FunctionalList <ScopeTreeNode> axisScopes) { ScopeTreeNode scopeTreeNode = default(ScopeTreeNode); if (!this.m_scopes.TryGetValue((IRIFDataScope)member, out scopeTreeNode)) { scopeTreeNode = (this.HasScope(axisScopes) ? new SubScopeNode(member, this.m_activeScopes.First) : new SubScopeNode(member, this.m_dataRegionScopes.First)); } this.AddScope(scopeTreeNode); axisScopes = axisScopes.Add(scopeTreeNode); }
protected override void InternalParse(string richText) { this.m_htmlLexer = new HtmlLexer(richText); int num = 0; FunctionalList <ListStyle> functionalList = FunctionalList <ListStyle> .Empty; HtmlElement.HtmlNodeType htmlNodeType = HtmlElement.HtmlNodeType.Element; HtmlElement.HtmlNodeType htmlNodeType2 = HtmlElement.HtmlNodeType.Element; HtmlElement.HtmlElementType htmlElementType = HtmlElement.HtmlElementType.None; HtmlElement.HtmlElementType htmlElementType2 = HtmlElement.HtmlElementType.None; while (this.m_htmlLexer.Read()) { this.m_currentHtmlElement = this.m_htmlLexer.CurrentElement; htmlElementType2 = this.m_currentHtmlElement.ElementType; htmlNodeType2 = this.m_currentHtmlElement.NodeType; switch (htmlNodeType2) { case HtmlElement.HtmlNodeType.Element: if (num != 0 && htmlElementType2 != HtmlElement.HtmlElementType.TITLE) { break; } switch (htmlElementType2) { case HtmlElement.HtmlElementType.TITLE: if (!this.m_currentHtmlElement.IsEmptyElement) { num++; } htmlElementType2 = htmlElementType; htmlNodeType2 = htmlNodeType; break; case HtmlElement.HtmlElementType.P: case HtmlElement.HtmlElementType.DIV: case HtmlElement.HtmlElementType.LI: case HtmlElement.HtmlElementType.H1: case HtmlElement.HtmlElementType.H2: case HtmlElement.HtmlElementType.H3: case HtmlElement.HtmlElementType.H4: case HtmlElement.HtmlElementType.H5: case HtmlElement.HtmlElementType.H6: this.ParseParagraphElement(htmlElementType2, functionalList); break; case HtmlElement.HtmlElementType.UL: case HtmlElement.HtmlElementType.OL: { this.FlushPendingLI(); this.CloseParagraph(); ListStyle listStyleForElement2 = this.GetListStyleForElement(htmlElementType2); functionalList = functionalList.Add(listStyleForElement2); base.m_currentParagraph.ListLevel = functionalList.Count; break; } case HtmlElement.HtmlElementType.SPAN: case HtmlElement.HtmlElementType.FONT: case HtmlElement.HtmlElementType.STRONG: case HtmlElement.HtmlElementType.STRIKE: case HtmlElement.HtmlElementType.B: case HtmlElement.HtmlElementType.I: case HtmlElement.HtmlElementType.U: case HtmlElement.HtmlElementType.S: case HtmlElement.HtmlElementType.EM: this.ParseTextRunElement(htmlElementType2); break; case HtmlElement.HtmlElementType.A: this.ParseActionElement(functionalList.Count); break; case HtmlElement.HtmlElementType.BR: if (htmlNodeType != HtmlElement.HtmlNodeType.EndElement) { this.AppendText(Environment.NewLine); } else { this.SetTextRunValue(Environment.NewLine); } break; default: htmlElementType2 = htmlElementType; htmlNodeType2 = htmlNodeType; break; } break; case HtmlElement.HtmlNodeType.Text: if (num == 0) { string text = this.m_currentHtmlElement.Value; if (htmlNodeType == HtmlElement.HtmlNodeType.Text) { this.AppendText(text); } else if (htmlElementType == HtmlElement.HtmlElementType.BR) { this.AppendText(this.HtmlTrimStart(text)); } else { if (base.m_currentParagraphInstance == null) { text = this.HtmlTrimStart(text); } if (!string.IsNullOrEmpty(text)) { this.SetTextRunValue(text); } else { htmlElementType2 = htmlElementType; htmlNodeType2 = htmlNodeType; } } } break; case HtmlElement.HtmlNodeType.EndElement: if (num != 0 && htmlElementType2 != HtmlElement.HtmlElementType.TITLE) { break; } switch (htmlElementType2) { case HtmlElement.HtmlElementType.TITLE: if (num > 0) { num--; } htmlElementType2 = htmlElementType; htmlNodeType2 = htmlNodeType; break; case HtmlElement.HtmlElementType.UL: case HtmlElement.HtmlElementType.OL: this.FlushPendingLI(); this.CloseParagraph(); if (functionalList.Count > 0) { ListStyle listStyleForElement = this.GetListStyleForElement(htmlElementType2); bool flag = false; FunctionalList <ListStyle> functionalList2 = functionalList; do { flag = (functionalList2.First == listStyleForElement); functionalList2 = functionalList2.Rest; }while (!flag && functionalList2.Count > 0); if (flag) { functionalList = functionalList2; base.m_currentParagraph.ListLevel = functionalList.Count; } } break; case HtmlElement.HtmlElementType.LI: this.CloseParagraph(); break; case HtmlElement.HtmlElementType.P: case HtmlElement.HtmlElementType.DIV: case HtmlElement.HtmlElementType.H1: case HtmlElement.HtmlElementType.H2: case HtmlElement.HtmlElementType.H3: case HtmlElement.HtmlElementType.H4: case HtmlElement.HtmlElementType.H5: case HtmlElement.HtmlElementType.H6: this.CloseParagraph(); base.m_currentParagraph = base.m_currentParagraph.RemoveParagraph(htmlElementType2); goto case HtmlElement.HtmlElementType.SPAN; case HtmlElement.HtmlElementType.SPAN: case HtmlElement.HtmlElementType.FONT: case HtmlElement.HtmlElementType.STRONG: case HtmlElement.HtmlElementType.STRIKE: case HtmlElement.HtmlElementType.B: case HtmlElement.HtmlElementType.I: case HtmlElement.HtmlElementType.U: case HtmlElement.HtmlElementType.S: case HtmlElement.HtmlElementType.EM: base.m_currentStyle = base.m_currentStyle.RemoveStyle(htmlElementType2); break; case HtmlElement.HtmlElementType.A: this.RevertActionElement(htmlElementType2); break; default: htmlElementType2 = htmlElementType; htmlNodeType2 = htmlNodeType; break; } break; } htmlNodeType = htmlNodeType2; htmlElementType = htmlElementType2; } if (base.m_paragraphInstanceCollection.Count == 0) { this.CreateTextRunInstance(); } base.m_currentParagraph = base.m_currentParagraph.RemoveAll(); }
private void RemoveGroupScope(ref FunctionalList <ScopeTreeNode> axisScopes) { axisScopes = axisScopes.Rest; m_activeScopes = m_activeScopes.Rest; }
private void ParseParagraphElement(HtmlElement.HtmlElementType elementType, FunctionalList <ListStyle> listStyles) { CloseParagraph(); if (m_currentParagraph.ElementType == HtmlElement.HtmlElementType.P) { m_currentParagraph = m_currentParagraph.RemoveParagraph(HtmlElement.HtmlElementType.P); m_currentStyle = m_currentStyle.RemoveStyle(HtmlElement.HtmlElementType.P); } if (elementType == HtmlElement.HtmlElementType.LI) { FlushPendingLI(); if (listStyles.Count > 0) { m_currentParagraph.ListStyle = listStyles.First; } else { m_currentParagraph.ListStyle = ListStyle.Bulleted; } } else { m_currentStyle = m_currentStyle.CreateChildStyle(elementType); m_currentParagraph = m_currentParagraph.CreateChildParagraph(elementType); switch (elementType) { case HtmlElement.HtmlElementType.H1: m_currentStyle.FontSize = StyleDefaults.H1FontSize; m_currentStyle.FontWeight = FontWeights.Bold; SetMarginTopAndBottom(StyleDefaults.H1Margin); break; case HtmlElement.HtmlElementType.H2: m_currentStyle.FontSize = StyleDefaults.H2FontSize; m_currentStyle.FontWeight = FontWeights.Bold; SetMarginTopAndBottom(StyleDefaults.H2Margin); break; case HtmlElement.HtmlElementType.H3: m_currentStyle.FontSize = StyleDefaults.H3FontSize; m_currentStyle.FontWeight = FontWeights.Bold; SetMarginTopAndBottom(StyleDefaults.H3Margin); break; case HtmlElement.HtmlElementType.H4: m_currentStyle.FontSize = StyleDefaults.H4FontSize; m_currentStyle.FontWeight = FontWeights.Bold; SetMarginTopAndBottom(StyleDefaults.H4Margin); break; case HtmlElement.HtmlElementType.H5: m_currentStyle.FontSize = StyleDefaults.H5FontSize; m_currentStyle.FontWeight = FontWeights.Bold; SetMarginTopAndBottom(StyleDefaults.H5Margin); break; case HtmlElement.HtmlElementType.H6: m_currentStyle.FontSize = StyleDefaults.H6FontSize; m_currentStyle.FontWeight = FontWeights.Bold; SetMarginTopAndBottom(StyleDefaults.H6Margin); break; case HtmlElement.HtmlElementType.P: SetMarginTopAndBottom(StyleDefaults.PMargin); break; } if (!m_currentHtmlElement.IsEmptyElement && m_currentHtmlElement.HasAttributes && m_allowMultipleParagraphs && m_currentHtmlElement.Attributes.TryGetValue("align", out string value)) { if (RichTextStyleTranslator.TranslateTextAlign(value, out TextAlignments textAlignment)) { m_currentStyle.TextAlign = textAlignment; } else { m_richTextLogger.RegisterInvalidValueWarning("align", value, m_currentHtmlElement.CharacterPosition); } } } SetStyleValues(isParagraph: true); }