/// <summary> /// Here we build the main structure of the chart as a collection of cells. We have to be a bit tricky about /// generating the header. /// </summary> /// <param name="nRowSpan"></param> /// <param name="nColSpan"></param> public override void OpenTableCell(int nRowSpan, int nColSpan) { if (m_titleStage == TitleStage.ktsStart && m_frags.Count > 0 && m_frags[m_frags.Count - 1] == ConstChartVc.kfragColumnGroupHeader) { // got the first group header m_titleStage = TitleStage.ktsGotFirstRowGroups; } else if (m_titleStage == TitleStage.ktsGotFirstRowGroups && m_frags.Count == 0) { // got the column groups, no longer in that, next thing is the notes header m_titleStage = TitleStage.ktsGotNotesHeaderCell; } else if (m_titleStage == TitleStage.ktsGotNotesHeaderCell) { // got the one last cell on the very first row, now starting the second row, close first and make a new row. m_writer.WriteEndElement(); // terminate the first header row. m_writer.WriteStartElement("row"); // second row headers m_writer.WriteAttributeString("type", "title2"); m_titleStage = TitleStage.ktsStartedSecondHeaderRow; } m_writer.WriteStartElement("cell"); if (m_fNextCellReversed) { m_fNextCellReversed = false; m_writer.WriteAttributeString("reversed", "true"); } m_writer.WriteAttributeString("cols", nColSpan.ToString()); m_writer.WriteStartElement("main"); base.OpenTableCell(nRowSpan, nColSpan); }
/// <summary> /// Called whenever we start the display of an object, we currently use it to catch the start of /// a row, basedon the frag. Overriding OpenTableRow() might be more natural, but I was trying to /// minimize changes to other DLLs, and those routines are not currently virtual in the base class. /// </summary> /// <param name="hvo"></param> /// <param name="ihvo"></param> protected override void OpenTheObject(int hvo, int ihvo) { int frag = m_frags[m_frags.Count - 1]; switch (frag) { case ConstChartVc.kfragChartRow: if (m_titleStage == TitleStage.ktsStartedSecondHeaderRow) { // This is the best way I've found to detect the end of the second header row // and terminate it. m_titleStage = TitleStage.ktsFinishedHeaders; m_writer.WriteEndElement(); } m_writer.WriteStartElement("row"); var row = m_rowRepo.GetObject(hvo); if (row.EndParagraph) { m_writer.WriteAttributeString("endPara", "true"); } else if (row.EndSentence) { m_writer.WriteAttributeString("endSent", "true"); } //ConstChartVc vc = m_vc as ConstChartVc; var clauseType = ConstChartVc.GetRowStyleName(row); m_writer.WriteAttributeString("type", clauseType); var label = row.Label.Text; if (!String.IsNullOrEmpty(label)) { m_writer.WriteAttributeString("id", label); } break; default: break; } base.OpenTheObject(hvo, ihvo); }
/// <summary> /// Called whenever we start the display of an object, we currently use it to catch the start of /// a row, basedon the frag. Overriding OpenTableRow() might be more natural, but I was trying to /// minimize changes to other DLLs, and those routines are not currently virtual in the base class. /// </summary> /// <param name="hvo"></param> /// <param name="ihvo"></param> protected override void OpenTheObject(int hvo, int ihvo) { int frag = m_frags[m_frags.Count - 1]; switch (frag) { case ConstChartVc.kfragChartRow: if (m_titleStage == TitleStage.ktsStartedSecondHeaderRow) { // This is the best way I've found to detect the end of the second header row // and terminate it. m_titleStage = TitleStage.ktsFinishedHeaders; m_writer.WriteEndElement(); } m_writer.WriteStartElement("row"); if (ConstituentChartLogic.GetFeature(m_cache.MainCacheAccessor, hvo, ConstituentChartLogic.EndParaFeatureName)) { m_writer.WriteAttributeString("endPara", "true"); } else if (ConstituentChartLogic.GetFeature(m_cache.MainCacheAccessor, hvo, ConstituentChartLogic.EndSentFeatureName)) { m_writer.WriteAttributeString("endSent", "true"); } ConstChartVc vc = m_vc as ConstChartVc; string clauseType = vc.GetRowStyleName(this, hvo); m_writer.WriteAttributeString("type", clauseType); string label = m_cache.GetMultiStringAlt(hvo, (int)CmAnnotation.CmAnnotationTags.kflidComment, m_wsLineNumber).Text; if (!String.IsNullOrEmpty(label)) { m_writer.WriteAttributeString("id", label); } break; default: break; } base.OpenTheObject(hvo, ihvo); }
/// <summary> /// Called whenever we start the display of an object, we currently use it to catch the start of /// a row, basedon the frag. Overriding OpenTableRow() might be more natural, but I was trying to /// minimize changes to other DLLs, and those routines are not currently virtual in the base class. /// </summary> /// <param name="hvo"></param> /// <param name="ihvo"></param> protected override void OpenTheObject(int hvo, int ihvo) { int frag = m_frags[m_frags.Count - 1]; switch (frag) { case ConstChartVc.kfragChartRow: if (m_titleStage == TitleStage.ktsStartedSecondHeaderRow) { // This is the best way I've found to detect the end of the second header row // and terminate it. m_titleStage = TitleStage.ktsFinishedHeaders; m_writer.WriteEndElement(); } m_writer.WriteStartElement("row"); if (ConstituentChartLogic.GetFeature(m_cache.MainCacheAccessor, hvo, ConstituentChartLogic.EndParaFeatureName)) m_writer.WriteAttributeString("endPara", "true"); else if (ConstituentChartLogic.GetFeature(m_cache.MainCacheAccessor, hvo, ConstituentChartLogic.EndSentFeatureName)) m_writer.WriteAttributeString("endSent", "true"); ConstChartVc vc = m_vc as ConstChartVc; string clauseType = vc.GetRowStyleName(this, hvo); m_writer.WriteAttributeString("type", clauseType); string label = m_cache.GetMultiStringAlt(hvo, (int)CmAnnotation.CmAnnotationTags.kflidComment, m_wsLineNumber).Text; if (!String.IsNullOrEmpty(label)) m_writer.WriteAttributeString("id", label); break; default: break; } base.OpenTheObject(hvo, ihvo); }
/// <summary> /// Called whenever we start the display of an object, we currently use it to catch the start of /// a row, basedon the frag. Overriding OpenTableRow() might be more natural, but I was trying to /// minimize changes to other DLLs, and those routines are not currently virtual in the base class. /// </summary> /// <param name="hvo"></param> /// <param name="ihvo"></param> protected override void OpenTheObject(int hvo, int ihvo) { int frag = m_frags[m_frags.Count - 1]; switch (frag) { case ConstChartVc.kfragChartRow: if (m_titleStage == TitleStage.ktsStartedSecondHeaderRow) { // This is the best way I've found to detect the end of the second header row // and terminate it. m_titleStage = TitleStage.ktsFinishedHeaders; m_writer.WriteEndElement(); } m_writer.WriteStartElement("row"); var row = m_rowRepo.GetObject(hvo); if (row.EndParagraph) m_writer.WriteAttributeString("endPara", "true"); else if (row.EndSentence) m_writer.WriteAttributeString("endSent", "true"); //ConstChartVc vc = m_vc as ConstChartVc; var clauseType = ConstChartVc.GetRowStyleName(row); m_writer.WriteAttributeString("type", clauseType); var label = row.Label.Text; if (!String.IsNullOrEmpty(label)) m_writer.WriteAttributeString("id", label); break; default: break; } base.OpenTheObject(hvo, ihvo); }