コード例 #1
0
 /// <summary>
 /// Checks that the ConstituentChartRow repository now contains the Hvo specified.
 /// </summary>
 /// <param name="hvo"></param>
 /// <param name="message"></param>
 public IConstChartRow VerifyCreatedRow(int hvo, string message)
 {
     try
     {
         return(m_rowRepo.GetObject(hvo));
     }
     catch
     {
         Assert.Fail("The hvo for " + message + " doesn't seem to be in the Row Repository!");
     }
     return(null);
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: ConstChartBody.cs プロジェクト: sillsdev/FieldWorks
		/// <summary>
		/// Make one.
		/// </summary>
		/// <param name="baseObj"></param>
		/// <param name="cache"></param>
		/// <param name="vwenv"></param>
		/// <param name="hvo"></param>
		public MakeCellsMethod(ConstChartVc baseObj, FdoCache cache, IVwEnv vwenv, int hvo)
		{
			m_this = baseObj;
			m_cache = cache;
			m_rowRepo = m_cache.ServiceLocator.GetInstance<IConstChartRowRepository>();
			m_partRepo = m_cache.ServiceLocator.GetInstance<IConstituentChartCellPartRepository>();

			// Decorator makes sure that things get put out in the right order if chart is RtL
			m_chart = baseObj.m_chart;
			//var sPopFormatting = m_cache.TsStrFactory.MakeString(Convert.ToString(m_chart.PDF), m_cache.DefaultAnalWs);
			m_vwenv = new ChartRowEnvDecorator(vwenv);

			m_hvoRow = hvo;
			m_row = m_rowRepo.GetObject(m_hvoRow);
		}