Esempio n. 1
0
            /*
             *                      /// <summary>
             *                      /// Override to remove the TAB key from treatment as a normal key.
             *                      /// </summary>
             *                      /// <param name="keyData"></param>
             *                      /// <returns>false, if it is a TAB key, otherwise whatever the superclass returns.</returns>
             *                      protected override bool IsInputKey(Keys keyData)
             *                      {
             *                              if (keyData == Keys.Tab)
             *                                      return false;
             *                              return base.IsInputKey(keyData);
             *                      }
             */

            public override void MakeRoot()
            {
                CheckDisposed();

                if (m_cache == null || DesignMode)
                {
                    return;
                }

                base.MakeRoot();

                m_rootb.DataAccess = m_cache.DomainDataByFlid;

                m_vc = m_info.Vc;
                if (m_vc == null)
                {
                    if (m_info.DisplayAsContext)
                    {
                        m_vc = new ContextVc(m_info);
                    }
                    else
                    {
                        m_vc = new SummaryVc(m_info);
                    }
                }

                // The root object is the one, if any, that the policy gives us.
                // If it doesn't give us one the vc will obtain a key string from the policy
                // directly. The frag argument is arbitrary. Note that we have to use a non-zero
                // HVO, even when it doesn't mean anything, to avoid triggering an Assert in the Views code.
                m_rootb.SetRootObject(m_info.Hvo == 0 ? 1 : m_info.Hvo, m_vc, 1, m_styleSheet);
            }
Esempio n. 2
0
 public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
 {
     if (tag == (int)StTxtPara.StTxtParaTags.kflidContents)
     {
         WriteStringProp(tag, "note", 0);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// :&gt; Inserting basic object property displays into the view.
 ///              The view looks up the value of the indicated property on the current open
 ///              object and displays it. The property must be a (non alternation) string property.
 /// </summary>
 public void AddStringProp(int tag, IVwViewConstructor vc)
 {
     EventHistory.Add(new StringPropAdded()
     {
         Hvo = OpenObject, Tag = tag, Vc = vc
     });
 }
Esempio n. 4
0
 public override void AddObj(int hvoItem, IVwViewConstructor vc, int frag)
 {
     if (frag == (int)SIL.FieldWorks.FdoUi.VcFrags.kfragHeadWord)
     {
         // In the course of this AddObj, typically we get AddString calls for
         // morpheme separators, AddObjProp for kflidLexemeForm,
         // AddStringAltMember for the form of the LF, NoteDependency for a homograph number,
         // and possibly AddString for the HN itself. We want to produce something like
         // <item type="cf" lang="xkal">-de<hn lang="en">2</hn></item>
         OpenItem("cf");
         m_fDoingHeadword        = true;
         m_fAwaitingHeadwordForm = true;
     }
     // (LT-9374) Export Variant Type information for variants
     if (frag == (int)SIL.FieldWorks.FdoUi.LexEntryVc.kfragVariantTypes)
     {
         m_fDoingVariantTypes = true;
         OpenItem("variantTypes");
         string icuCode = m_cache.LanguageWritingSystemFactoryAccessor.GetStrFromWs(m_cache.DefaultAnalWs);
         m_writer.WriteAttributeString("lang", icuCode);
     }
     base.AddObj(hvoItem, vc, frag);
     if (frag == (int)SIL.FieldWorks.FdoUi.VcFrags.kfragHeadWord)
     {
         CloseItem();
         m_fDoingHeadword        = false;
         m_fDoingHomographNumber = false;
         WritePendingItem("hn", ref m_tssPendingHomographNumber);
     }
     if (frag == (int)SIL.FieldWorks.FdoUi.LexEntryVc.kfragVariantTypes)
     {
         CloseItem();
         m_fDoingVariantTypes = false;
     }
 }
Esempio n. 5
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds the obj vec items.
        /// </summary>
        /// <param name="tag">The tag.</param>
        /// <param name="vc">The vc.</param>
        /// <param name="frag">The frag.</param>
        /// ------------------------------------------------------------------------------------
        public override void AddObjVecItems(int tag, IVwViewConstructor vc, int frag)
        {
            CurrentContext ccOld = WriteFieldStartTag(tag);

            OpenProp(tag);
            int cobj = DataAccess.get_VecSize(CurrentObject(), tag);

            for (int i = 0; i < cobj; i++)
            {
                int hvoItem = DataAccess.get_VecItem(CurrentObject(), tag, i);
                OpenTheObject(hvoItem, i);
                CurrentContext ccPrev = WriteClassStartTag(hvoItem);

                vc.Display(this, hvoItem, frag);

                WriteClassEndTag(hvoItem, ccPrev);
                CloseTheObject();
                if (Finished)
                {
                    break;
                }
                if (m_fCancel)
                {
                    throw new CancelException(XMLViewsStrings.ConfiguredExportHasBeenCancelled);
                }
            }

            CloseProp();
            WriteFieldEndTag(tag, ccOld);
        }
Esempio n. 6
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Member AddUnicodeProp
        /// </summary>
        /// <param name="tag">tag</param>
        /// <param name="ws">ws</param>
        /// <param name="_vwvc">_vwvc</param>
        /// ------------------------------------------------------------------------------------
        public override void AddUnicodeProp(int tag, int ws, IVwViewConstructor _vwvc)
        {
            CurrentContext ccOld = WriteFieldStartTag(tag);
            string         sText = DataAccess.get_UnicodeProp(CurrentObject(), tag);

            // Need to ensure that sText is NFC for export.
            Icu.InitIcuDataDir();
            if (!Icu.IsNormalized(sText, Icu.UNormalizationMode.UNORM_NFC))
            {
                sText = Icu.Normalize(sText, Icu.UNormalizationMode.UNORM_NFC);
            }
            string sWs = WritingSystemId(ws);

            IndentLine();
            if (String.IsNullOrEmpty(sWs))
            {
                m_writer.WriteLine("<Uni>{0}</Uni>", XmlUtils.MakeSafeXml(sText));
            }
            else
            {
                m_writer.WriteLine("<AUni ws=\"{0}\">{1}</AUni>",
                                   sWs, XmlUtils.MakeSafeXml(sText));
            }
            WriteFieldEndTag(tag, ccOld);
        }
Esempio n. 7
0
 /// <summary>
 /// :&gt; ENHANCE JohnT: we should have individual methods and default formats
 ///             :&gt; for more of the basic types.
 ///             :&gt; String alternations.
 ///              Add a single, isolated alternative (of the indicated property of the open object).
 /// </summary>
 public void AddStringAltMember(int tag, int ws, IVwViewConstructor vc)
 {
     EventHistory.Add(new StringAltMemberAdded()
     {
         Hvo = OpenObject, Tag = tag, Ws = ws, Vc = vc
     });
 }
Esempio n. 8
0
 public override void AddObj(int hvo, IVwViewConstructor _vwvc, int frag)
 {
     if (!IsRtL)
     {
         return;                 // Don't record calls for LtR, they don't go through the Decorator we're testing.
     }
     base.AddObj(hvo, _vwvc, frag);
 }
Esempio n. 9
0
 public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
 {
     if (!IsRtL)
     {
         return;                 // Don't record calls for LtR, they don't go through the Decorator we're testing.
     }
     base.AddStringProp(tag, _vwvc);
 }
Esempio n. 10
0
 public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
 {
     if (tag == m_flidStringValue)
     {
         // <item type="punct">
         WriteItem(tag, "punct", 0);
     }
 }
Esempio n. 11
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds the prop.
        /// </summary>
        /// <param name="tag">The tag.</param>
        /// <param name="vc">The vc.</param>
        /// <param name="frag">The frag.</param>
        /// ------------------------------------------------------------------------------------
        public override void AddProp(int tag, IVwViewConstructor vc, int frag)
        {
            CurrentContext ccOld = WriteFieldStartTag(tag);

            base.AddProp(tag, vc, frag);

            WriteFieldEndTag(tag, ccOld);
        }
 public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
 {
     if (tag == PunctuationFormTags.kflidForm)
     {
         // <item type="punct">
         WriteItem(tag, "punct", 0);
     }
 }
 public virtual void AddProp(int tag, IVwViewConstructor _vwvc, int frag)
 {
     if (!IsRtL)
     {
         m_vwEnv.AddProp(tag, _vwvc, frag);
         return;
     }
     throw new NotImplementedException();
 }
Esempio n. 14
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 ///
 /// </summary>
 /// <param name="sda"></param>
 /// <param name="hvo"></param>
 /// <param name="vc"></param>
 /// <param name="frags"></param>
 /// <param name="styleSheet"></param>
 /// ------------------------------------------------------------------------------------
 public PrintRootSite(ISilDataAccess sda, int hvo, IVwViewConstructor vc, int frags,
                      IVwStylesheet styleSheet)
 {
     m_sda        = sda;
     m_hvo        = hvo;
     m_vc         = vc;
     m_frags      = frags;
     m_styleSheet = styleSheet;
 }
Esempio n. 15
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// <param name="sda"></param>
		/// <param name="hvo"></param>
		/// <param name="vc"></param>
		/// <param name="frags"></param>
		/// <param name="styleSheet"></param>
		/// ------------------------------------------------------------------------------------
		public PrintRootSite(ISilDataAccess sda, int hvo, IVwViewConstructor vc, int frags,
			IVwStylesheet styleSheet)
		{
			m_sda = sda;
			m_hvo = hvo;
			m_vc = vc;
			m_frags = frags;
			m_styleSheet = styleSheet;
		}
Esempio n. 16
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FindReplaceCollectorEnvBase"/> class.
		/// </summary>
		/// <param name="vc">The view constructor.</param>
		/// <param name="sda">Date access to get prop values etc.</param>
		/// <param name="hvoRoot">The root object to display.</param>
		/// <param name="frag">The fragment.</param>
		/// <param name="vwPattern">The find/replace pattern.</param>
		/// <param name="searchKiller">Used to interrupt a find/replace</param>
		/// <remarks>If the base environment is not null, it is used for various things,
		/// such as obtaining 'outer object' information.</remarks>
		/// ------------------------------------------------------------------------------------
		public FindReplaceCollectorEnvBase(IVwViewConstructor vc, ISilDataAccess sda,
			int hvoRoot, int frag, IVwPattern vwPattern, IVwSearchKiller searchKiller)
			: base(null, sda, hvoRoot)
		{
			m_vc = vc;
			m_frag = frag;
			m_Pattern = vwPattern;
			m_searchKiller = searchKiller;
			m_textSourceInit = VwMappedTxtSrcClass.Create();
		}
Esempio n. 17
0
        int m_wsLineNumber;         // ws to use for line numbers.

        public DiscourseExporter(FdoCache cache, XmlWriter writer, int hvoRoot, IVwViewConstructor vc,
                                 int wsLineNumber)
            : base(null, cache.MainCacheAccessor, hvoRoot)
        {
            m_cache        = cache;
            m_writer       = writer;
            m_vc           = vc;
            m_wsLineNumber = wsLineNumber;
            m_chart        = DsConstChart.CreateFromDBObject(cache, hvoRoot);
        }
 public virtual void AddStringProp(int tag, IVwViewConstructor _vwvc)
 {
     if (!IsRtL)
     {
         m_vwEnv.AddStringProp(tag, _vwvc);
         return;
     }
     m_calledMethods.Add(new StoredMethod(DecoratorMethodTypes.AddStringProp, new object[] { tag, _vwvc }));
     m_numOfCalls++;
 }
 public virtual void AddObj(int hvo, IVwViewConstructor _vwvc, int frag)
 {
     if (!IsRtL)
     {
         m_vwEnv.AddObj(hvo, _vwvc, frag);
         return;
     }
     m_calledMethods.Add(new StoredMethod(DecoratorMethodTypes.AddObj, new object[] { hvo, _vwvc, frag }));
     m_numOfCalls++;
 }
Esempio n. 20
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:FindCollectorEnv"/> class.
 /// </summary>
 /// <param name="vc">The view constructor.</param>
 /// <param name="sda">Date access to get prop values etc.</param>
 /// <param name="hvoRoot">The root object to display.</param>
 /// <param name="frag">The fragment.</param>
 /// <param name="vwPattern">The find/replace pattern.</param>
 /// <param name="searchKiller">Used to interrupt a find/replace</param>
 /// <remarks>If the base environment is not null, it is used for various things,
 /// such as obtaining 'outer object' information.</remarks>
 /// ------------------------------------------------------------------------------------
 public FindCollectorEnv(IVwViewConstructor vc, ISilDataAccess sda,
                         int hvoRoot, int frag, IVwPattern vwPattern, IVwSearchKiller searchKiller)
     : base(null, sda, hvoRoot)
 {
     m_vc             = vc;
     m_frag           = frag;
     m_Pattern        = vwPattern;
     m_searchKiller   = searchKiller;
     m_textSourceInit = VwMappedTxtSrcClass.Create();
 }
Esempio n. 21
0
		int m_wsLineNumber; // ws to use for line numbers.

		public DiscourseExporter(FdoCache cache, XmlWriter writer, int hvoRoot, IVwViewConstructor vc,
			int wsLineNumber)
			: base(null, cache.MainCacheAccessor, hvoRoot)
		{
			m_cache = cache;
			m_writer = writer;
			m_vc = vc;
			m_wsLineNumber = wsLineNumber;
			m_chart = DsConstChart.CreateFromDBObject(cache, hvoRoot);
		}
 public virtual void AddObjProp(int tag, IVwViewConstructor _vwvc, int frag)
 {
     if (!IsRtL)
     {
         m_vwEnv.AddObjProp(tag, _vwvc, frag);
         return;
     }
     m_iStartEmbedding.Add(m_numOfCalls);
     m_calledMethods.Add(new StoredMethod(DecoratorMethodTypes.AddObjProp, new object[] { tag, _vwvc, frag }));
     m_numOfCalls++;
 }
Esempio n. 23
0
        private readonly int m_wsLineNumber;         // ws to use for line numbers.

        public DiscourseExporter(FdoCache cache, XmlWriter writer, int hvoRoot, IVwViewConstructor vc,
                                 int wsLineNumber)
            : base(null, cache.MainCacheAccessor, hvoRoot)
        {
            m_cache        = cache;
            m_writer       = writer;
            m_vc           = vc;
            m_wsLineNumber = wsLineNumber;
            m_chart        = m_cache.ServiceLocator.GetInstance <IDsConstChartRepository>().GetObject(hvoRoot);
            m_rowRepo      = m_cache.ServiceLocator.GetInstance <IConstChartRowRepository>();
        }
Esempio n. 24
0
		private readonly int m_wsLineNumber; // ws to use for line numbers.

		public DiscourseExporter(FdoCache cache, XmlWriter writer, int hvoRoot, IVwViewConstructor vc,
			int wsLineNumber)
			: base(null, cache.MainCacheAccessor, hvoRoot)
		{
			m_cache = cache;
			m_writer = writer;
			m_vc = vc;
			m_wsLineNumber = wsLineNumber;
			m_chart = m_cache.ServiceLocator.GetInstance<IDsConstChartRepository>().GetObject(hvoRoot);
			m_rowRepo = m_cache.ServiceLocator.GetInstance<IConstChartRowRepository>();
		}
Esempio n. 25
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Member AddStringAltMember
        /// </summary>
        /// <param name="tag">tag</param>
        /// <param name="ws">ws</param>
        /// <param name="_vwvc">_vwvc</param>
        /// ------------------------------------------------------------------------------------
        public override void AddStringAltMember(int tag, int ws, IVwViewConstructor _vwvc)
        {
            CurrentContext ccOld = WriteFieldStartTag(tag);

            ITsString tss       = DataAccess.get_MultiStringAlt(CurrentObject(), tag, ws);
            int       cchIndent = TabsToIndent() * 4;

            tss.WriteAsXmlExtended(m_strm, m_cache.LanguageWritingSystemFactoryAccessor, cchIndent,
                                   ws, false, m_fUseRFC4646);

            WriteFieldEndTag(tag, ccOld);
        }
Esempio n. 26
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Member AddStringProp
        /// </summary>
        /// <param name="tag">tag</param>
        /// <param name="_vwvc">_vwvc</param>
        /// ------------------------------------------------------------------------------------
        public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
        {
            ITsString tss = DoReplace(m_sda.get_StringProp(m_hvoCurr, tag));

            if (tss != null)
            {
                m_sda.SetString(m_hvoCurr, tag, tss);
                // We shouldn't have to do this in the new FDO
                //m_sda.PropChanged(null, (int)PropChangeType.kpctNotifyAll, m_hvoCurr, tag,
                //    0, tss.Length, tss.Length);
            }
        }
Esempio n. 27
0
        public DiscourseExportDialog(Mediator mediator, int hvoRoot, IVwViewConstructor vc,
                                     int wsLineNumber) : base(mediator)
        {
            m_hvoRoot = hvoRoot;
            m_vc      = vc;

            m_helpTopic        = "khtpExportDiscourse";
            columnHeader1.Text = DiscourseStrings.ksFormat;
            columnHeader2.Text = DiscourseStrings.ksExtension;
            Text           = DiscourseStrings.ksExportDiscourse;
            m_wsLineNumber = wsLineNumber;
        }
 public override void AddProp(int tag, IVwViewConstructor vc, int frag)
 {
     if (tag == InterlinVc.ktagGlossAppend)
     {
         m_fDoingGlossAppend = true;
     }
     base.AddProp(tag, vc, frag);
     if (tag == InterlinVc.ktagGlossAppend)
     {
         m_fDoingGlossAppend = false;
     }
 }
Esempio n. 29
0
		public DiscourseExportDialog(Mediator mediator, int hvoRoot, IVwViewConstructor vc,
			int wsLineNumber) : base(mediator)
		{
			m_hvoRoot = hvoRoot;
			m_vc = vc;

			m_helpTopic = "khtpExportDiscourse";
			columnHeader1.Text = DiscourseStrings.ksFormat;
			columnHeader2.Text = DiscourseStrings.ksExtension;
			Text = DiscourseStrings.ksExportDiscourse;
			m_wsLineNumber = wsLineNumber;
		}
Esempio n. 30
0
 public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
 {
     if (tag == PunctuationFormTags.kflidForm)
     {
         // <item type="punct">
         WriteItem(tag, "punct", 0);
     }
     else if (((IFwMetaDataCacheManaged)m_cache.MetaDataCacheAccessor).IsCustom(tag))
     {
         // custom fields are not multi-strings, so pass 0 for the ws
         WriteItem(tag, m_cache.MetaDataCacheAccessor.GetFieldName(tag), 0);
     }
 }
Esempio n. 31
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds the obj prop.
        /// </summary>
        /// <param name="tag">The tag.</param>
        /// <param name="vc">The vc.</param>
        /// <param name="frag">The frag.</param>
        /// ------------------------------------------------------------------------------------
        public override void AddObjProp(int tag, IVwViewConstructor vc, int frag)
        {
            CurrentContext ccOld = WriteFieldStartTag(tag);

            //m_writer.WriteLine("<!-- AddObjProp: hvo={0}, tag={1}, frag={2} -->", CurrentObject(), tag, frag);
            WriteDestClassStartTag(tag);

            base.AddObjProp(tag, vc, frag);

            WriteDestClassEndTag(tag);

            WriteFieldEndTag(tag, ccOld);
        }
Esempio n. 32
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Adds the obj.
        /// </summary>
        /// <param name="hvoItem">The hvo item.</param>
        /// <param name="vc">The vc.</param>
        /// <param name="frag">The frag.</param>
        /// ------------------------------------------------------------------------------------
        public override void AddObj(int hvoItem, IVwViewConstructor vc, int frag)
        {
            CurrentContext ccOld = WriteClassStartTag(hvoItem);

            base.AddObj(hvoItem, vc, frag);

            WriteClassEndTag(hvoItem, ccOld);

            if (m_fCancel)
            {
                throw new CancelException(XMLViewsStrings.ConfiguredExportHasBeenCancelled);
            }
        }
        public override void AddUnicodeProp(int tag, int ws, IVwViewConstructor _vwvc)
        {
            switch (tag)
            {
            case MoMorphTypeTags.kflidPrefix:
                m_sPendingPrefix = m_sda.get_UnicodeProp(m_hvoCurr, tag);
                break;

            case MoMorphTypeTags.kflidPostfix:
                m_writer.WriteString(m_sda.get_UnicodeProp(m_hvoCurr, tag));
                break;
            }
            base.AddUnicodeProp(tag, ws, _vwvc);
        }
Esempio n. 34
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Member AddStringAltMember
        /// </summary>
        /// <param name="tag">tag</param>
        /// <param name="ws">ws</param>
        /// <param name="_vwvc">_vwvc</param>
        /// ------------------------------------------------------------------------------------
        public override void AddStringAltMember(int tag, int ws, IVwViewConstructor _vwvc)
        {
            ITsString tss = DoReplace(m_sda.get_MultiStringAlt(m_hvoCurr, tag, ws));

            if (tss != null)
            {
                m_sda.SetMultiStringAlt(m_hvoCurr, tag, ws, tss);
                // We shouldn't have to do this in the new FDO
                //// For multi-string properties, the "ivMin" parameter to PropChanged is
                //// really the writing system HVO (per documentation in idh file).
                //m_sda.PropChanged(null, (int)PropChangeType.kpctNotifyAll, m_hvoCurr, tag,
                //    ws, tss.Length, tss.Length);
            }
        }
Esempio n. 35
0
 public override void AddObjProp(int tag, IVwViewConstructor vc, int frag)
 {
     m_frags.Add(frag);
     switch (frag)
     {
     default:
         break;
     }
     base.AddObjProp(tag, vc, frag);
     switch (frag)
     {
     default:
         break;
     }
     m_frags.RemoveAt(m_frags.Count - 1);
 }
Esempio n. 36
0
			public override void MakeRoot()
			{
				CheckDisposed();
				base.MakeRoot();

				if (m_fdoCache == null || DesignMode)
					return;

				// A crude way of making sure the property we want is loaded into the cache.
				m_obj = m_fdoCache.ServiceLocator.GetInstance<ICmObjectRepository>().GetObject(m_hvoObj);

				CellarPropertyType type = (CellarPropertyType)m_fdoCache.DomainDataByFlid.MetaDataCache.GetFieldType(m_flid);
				if (type == CellarPropertyType.Unicode)
				{
					m_vc = new UnicodeStringSliceVc(m_flid, m_ws, m_fdoCache);
				}
				else if (type == CellarPropertyType.String)
				{
					// Even if we were given a writing system, we must not use it if not a multistring,
					// otherwise the VC crashes when it tries to read the property as multilingual.
					m_vc = new StringSliceVc(m_flid, m_fdoCache, m_mediator);
					(m_vc as StringSliceVc).ShowWsLabel = m_fShowWsLabel;
				}
				else
				{
					m_vc = new StringSliceVc(m_flid, m_ws, m_fdoCache, m_mediator);
					(m_vc as StringSliceVc).ShowWsLabel = m_fShowWsLabel;
				}

				// Review JohnT: why doesn't the base class do this??
				m_rootb = VwRootBoxClass.Create();
				m_rootb.SetSite(this);

				// And maybe this too, at least by default?
				m_rootb.DataAccess = m_fdoCache.DomainDataByFlid;

				// arg3 is a meaningless initial fragment, since this VC only displays one thing.
				// arg4 could be used to supply a stylesheet.
				m_rootb.SetRootObject(m_hvoObj, m_vc, 1, m_styleSheet);
			}
Esempio n. 37
0
		public override void AddStringAltMember(int tag, int ws, IVwViewConstructor _vwvc)
		{
			if (tag == (int)WfiWordform.WfiWordformTags.kflidForm)
			{
				if(m_frags.Contains(ConstChartVc.kfragCcaMoved))
					WriteStringProp(tag, "word", ws, "moved", "true");
				else
					WriteStringProp(tag, "word", ws);
			}
			else if (tag == (int)WfiGloss.WfiGlossTags.kflidForm)
			{
				m_wsGloss = ws;
				string val = m_sda.get_MultiStringAlt(m_hvoCurr, tag, ws).Text;
				if (val == null)
					val = "";
				m_glossesInCellCollector.Add(val);
			}
			else if (tag == (int) CmAnnotation.CmAnnotationTags.kflidComment)
			{
				switch (m_frags[m_frags.Count - 1])
				{
					case ConstChartVc.kfragCca:
						if (m_cache.GetVectorSize(m_hvoCurr,
								(int)CmIndirectAnnotation.CmIndirectAnnotationTags.kflidAppliesTo) == 0)
						{
							WriteStringProp(tag, "lit", ws); // missing marker.
							break;
						}
						int hvoTarget = m_cache.GetVectorItem(m_hvoCurr,
								(int)CmIndirectAnnotation.CmIndirectAnnotationTags.kflidAppliesTo, 0); // the cca we refer to
						if (ConstituentChartLogic.HasPreviousMovedItemOnLine(m_chart, hvoTarget))
							WriteStringProp(tag, "moveMkr", ws, "targetFirstOnLine", "false");
						else
							WriteStringProp(tag, "moveMkr", ws);
						break;
					case ConstChartVc.kfragComment:
						WriteStringProp(tag, "clauseMkr", ws, "target", m_sda.get_MultiStringAlt(m_hvoCurr, tag, ws).Text);
						break;
					case ConstChartVc.kfragChartRow:
						WriteStringProp(tag, "rownum", ws);
						break;
				}
			}
			else if (tag == (int)CmPossibility.CmPossibilityTags.kflidAbbreviation)
			{
				// That makes it a list reference
				WriteStringProp(tag, "listRef", ws);
			}
		}
Esempio n. 38
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Member AddStringProp
		/// </summary>
		/// <param name="tag">tag</param>
		/// <param name="_vwvc">_vwvc</param>
		/// ------------------------------------------------------------------------------------
		public virtual void AddStringProp(int tag, IVwViewConstructor _vwvc)
		{
			if (Finished)
				return;
			OpenProp(tag);
			AddTsString(m_sda.get_StringProp(m_hvoCurr, tag));
			CloseProp();
		}
Esempio n. 39
0
			/// <summary>
			/// Executes in two distinct scenarios.
			///
			/// 1. If disposing is true, the method has been called directly
			/// or indirectly by a user's code via the Dispose method.
			/// Both managed and unmanaged resources can be disposed.
			///
			/// 2. If disposing is false, the method has been called by the
			/// runtime from inside the finalizer and you should not reference (access)
			/// other managed objects, as they already have been garbage collected.
			/// Only unmanaged resources can be disposed.
			/// </summary>
			/// <param name="disposing"></param>
			/// <remarks>
			/// If any exceptions are thrown, that is fine.
			/// If the method is being done in a finalizer, it will be ignored.
			/// If it is thrown by client code calling Dispose,
			/// it needs to be handled by fixing the bug.
			///
			/// If subclasses override this method, they should call the base implementation.
			/// </remarks>
			protected override void Dispose(bool disposing)
			{
				//Debug.WriteLineIf(!disposing, "****************** " + GetType().Name + " 'disposing' is false. ******************");
				// Must not be run more than once.
				if (IsDisposed)
					return;

				base.Dispose(disposing);

				if (disposing)
				{
					// Dispose managed resources here.
					if (m_vc != null && m_vc is IDisposable)
						(m_vc as IDisposable).Dispose();
				}

				// Dispose unmanaged resources here, whether disposing is true or false.
				m_obj = null;
				m_vc = null;
			}
		public void SetRootObjects(int[] _rghvo, IVwViewConstructor[] _rgpvwvc, int[] _rgfrag,
			IVwStylesheet _ss, int chvo)
		{
			throw new NotImplementedException();
		}
		public void SetRootVariant(object v, IVwStylesheet _ss, IVwViewConstructor _vwvc, int frag)
		{
			throw new NotImplementedException();
		}
Esempio n. 42
0
		/// -------------------------------------------------------------------------------------
		/// <summary>
		/// Create a header or footer stream
		/// </summary>
		/// <param name="vc">The view constructor used to lay out the header or footer stream
		/// </param>
		/// <param name="hvoRoot">The ID of the CmPubHeader object which will supply the layout
		/// details to the view contructor</param>
		/// <param name="xpLeftMargin">Left margin in printer pixels (we could recalc this, but
		/// since the caller already has it, it's faster to just pass it)</param>
		/// <param name="dympMaxHeight">Maximum height allowed for the header or footer stream,
		/// in millipoints</param>
		/// <param name="dypHeight">Height of the laid out data (limited by dypMaxHeight)</param>
		/// <returns></returns>
		/// -------------------------------------------------------------------------------------
		protected IVwLayoutStream CreateHeaderOrFooter(IVwViewConstructor vc, int hvoRoot,
			int xpLeftMargin, int dympMaxHeight, out int dypHeight)
		{
			IVwLayoutStream stream = VwLayoutStreamClass.Create();
			stream.SetManager(this);

			IVwRootBox rootbox = (IVwRootBox)stream;
			rootbox.SetSite(Publication);
			rootbox.DataAccess = m_configurer.DataAccess;
			rootbox.SetRootObject(hvoRoot, vc, HeaderFooterVc.kfragPageHeaderFooter,
				m_configurer.StyleSheet);

			// Layout the stream
			IVwGraphics vg = Publication.PrinterGraphics;
			try
			{
				rootbox.Layout(vg, AvailablePageWidthInPrinterPixels);
			}
			finally
			{
				Publication.ReleaseGraphics(vg);
			}

			// Limit the height to no more than the given maximum
			dypHeight = Math.Min(rootbox.Height,
				(int)(dympMaxHeight * Publication.DpiYPrinter / MiscUtils.kdzmpInch));

			return stream;
		}
Esempio n. 43
0
		/// -------------------------------------------------------------------------------------
		/// <summary>
		/// Configurer should call this method for each subordinate stream (such as foootnotes)
		/// after creating the main stream.
		/// </summary>
		/// <param name="hvoRoot">Top-level object to be displayed in this stream.</param>
		/// <param name="frag">The id of the top-level fragment for this stream</param>
		/// <param name="vc">The view constructor to be used for laying out this stream</param>
		/// <param name="subStreamDelegate">Implements view-specific callback methods</param>
		/// -------------------------------------------------------------------------------------
		public void AddSubordinateStream(int hvoRoot, int frag, IVwViewConstructor vc,
			ISubordinateStreamDelegate subStreamDelegate)
		{
			CheckDisposed();

			SubordinateStream subStream;
			subStream.m_fShared = false;
			subStream.m_vc = vc;
			subStream.m_delegate = subStreamDelegate;
			subStream.m_stream = VwLayoutStreamClass.Create();
			PublicationControl.SetAccessibleStreamName(subStream.m_stream,
				Publication.AccessibleName + "_SubordinateStream");

			subStream.m_stream.SetManager(this);
			IVwRootBox rootbox = (IVwRootBox)subStream.m_stream;
			rootbox.SetSite(Publication);
			rootbox.DataAccess = m_configurer.DataAccess;
			rootbox.SetRootObject(hvoRoot, vc, frag, m_configurer.StyleSheet);
			m_subStreams.Add(subStream);
		}
Esempio n. 44
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Member AddStringAltMember
		/// </summary>
		/// <param name="tag">tag</param>
		/// <param name="ws">ws</param>
		/// <param name="_vwvc">_vwvc</param>
		/// ------------------------------------------------------------------------------------
		public virtual void AddStringAltMember(int tag, int ws, IVwViewConstructor _vwvc)
		{
			if (Finished)
				return;
			OpenProp(tag);
			AddTsString(m_sda.get_MultiStringAlt(m_hvoCurr, tag, ws));
			CloseProp();
		}
Esempio n. 45
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// For our purpose, laziness is not relevant. Equivalent to the non-lazy version.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void AddLazyVecItems(int tag, IVwViewConstructor vc, int frag)
		{
			AddObjVecItems(tag, vc, frag);
		}
		public void GetRootObject(out int _hvo, out IVwViewConstructor _pvwvc, out int _frag,
			out IVwStylesheet _pss)
		{
			throw new NotImplementedException();
		}
Esempio n. 47
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Rarely if ever used.
		/// </summary>
		/// <param name="_rghvo">_rghvo</param>
		/// <param name="chvo">chvo</param>
		/// <param name="_vwvc">_vwvc</param>
		/// <param name="frag">frag</param>
		/// ------------------------------------------------------------------------------------
		public void AddLazyItems(int[] _rghvo, int chvo, IVwViewConstructor _vwvc, int frag)
		{
			throw new NotImplementedException("AddLazyItems is not yet implemented");
		}
Esempio n. 48
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the obj prop.
		/// </summary>
		/// <param name="tag">The tag.</param>
		/// <param name="vc">The vc.</param>
		/// <param name="frag">The frag.</param>
		/// ------------------------------------------------------------------------------------
		public virtual void AddObjProp(int tag, IVwViewConstructor vc, int frag)
		{
			if (Finished)
				return;
			int hvoItem = m_sda.get_ObjectProp(m_hvoCurr, tag);
			if (hvoItem != 0)
			{
				OpenProp(tag);
				OpenTheObject(hvoItem, 0);
				vc.Display(this, hvoItem, frag);
				CloseTheObject();
				CloseProp();
			}
		}
Esempio n. 49
0
		/// <summary>
		/// Executes in two distinct scenarios.
		///
		/// 1. If disposing is true, the method has been called directly
		/// or indirectly by a user's code via the Dispose method.
		/// Both managed and unmanaged resources can be disposed.
		///
		/// 2. If disposing is false, the method has been called by the
		/// runtime from inside the finalizer and you should not reference (access)
		/// other managed objects, as they already have been garbage collected.
		/// Only unmanaged resources can be disposed.
		/// </summary>
		/// <param name="disposing"></param>
		/// <remarks>
		/// If any exceptions are thrown, that is fine.
		/// If the method is being done in a finalizer, it will be ignored.
		/// If it is thrown by client code calling Dispose,
		/// it needs to be handled by fixing the bug.
		///
		/// If subclasses override this method, they should call the base implementation.
		/// </remarks>
		protected virtual void Dispose(bool disposing)
		{
			System.Diagnostics.Debug.WriteLineIf(!disposing, "****** Missing Dispose() call for " + GetType().Name + ". ****** ");
			// Must not be run more than once.
			if (m_isDisposed)
				return;

			IVwRootBox rootb;
			if (disposing)
			{
				// Dispose managed resources here.
				if (m_subStreams != null)
				{
					foreach (SubordinateStream stream in m_subStreams)
					{
						if (!stream.m_fShared)
						{
							rootb = stream.m_stream as IVwRootBox;
							if (rootb != null)
								rootb.Close();
							var disposableStreamVc = stream.m_vc as IDisposable;
							if (disposableStreamVc != null)
								disposableStreamVc.Dispose();
						}
					}
					m_subStreams.Clear();
				}
				var disposable = m_mainVc as IDisposable;
				if (disposable != null)
					disposable.Dispose();
				foreach (var hfVc in m_CreatedHfVcs)
				{
					disposable = hfVc as IDisposable;
					if (disposable != null)
						disposable.Dispose();
				}
				m_CreatedHfVcs.Clear();
			}

			// Dispose unmanaged resources here, whether disposing is true or false.
			rootb = m_mainLayoutStream as IVwRootBox;
			if (rootb != null)
				rootb.Close();

			m_mainLayoutStream = null;
			m_subStreams = null;
			m_mainVc = null;
			m_CreatedHfVcs = null;
			m_isDisposed = true;
		}
Esempio n. 50
0
		public override void AddObj(int hvoItem, IVwViewConstructor vc, int frag)
		{
			m_frags.Add(frag);
			base.AddObj (hvoItem, vc, frag);
			m_frags.RemoveAt(m_frags.Count - 1);
		}
Esempio n. 51
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Configure the main view and stuff.
		/// </summary>
		/// <remarks>This should only get called once during the lifetime of this object
		/// </remarks>
		/// ------------------------------------------------------------------------------------
		protected internal void Configure()
		{
			if (m_configurer == null ||
				m_configurer.DataAccess == null ||
				m_mainLayoutStream != null)
				return;

			int hvoMainObj = m_configurer.MainObjectId;
			if (hvoMainObj == 0)
				return;

			m_mainVc = m_configurer.MakeMainVc(this);
			m_mainLayoutStream = VwLayoutStreamClass.Create();
			m_mainLayoutStream.SetManager(this);

			PublicationControl.SetAccessibleStreamName(m_mainLayoutStream, m_Name);

			IVwRootBox rootbox = MainRootBox;
			rootbox.SetSite(Publication);

			m_configurer.ConfigureSubordinateViews(this);

			rootbox.DataAccess = m_configurer.DataAccess;
			rootbox.SetRootObject(hvoMainObj, m_mainVc, m_configurer.MainFragment,
				m_configurer.StyleSheet);

			// This was taken out as it was causing lazy boxes to be expanded that hadn't been
			// layed out yet. We still get an initial selection (set in PublicationControl.OnPaint)
			// so it seems to be fine.
			// 			try
			//			{
			//				rootbox.MakeSimpleSel(true, true, false, true);
			//			}
			//			catch
			//			{
			//			}
		}
Esempio n. 52
0
		public override void AddObjProp(int tag, IVwViewConstructor vc, int frag)
		{
			m_frags.Add(frag);
			switch (frag)
			{
				default:
					break;
			}
			base.AddObjProp(tag, vc, frag);
			switch (frag)
			{
				default:
					break;
			}
			m_frags.RemoveAt(m_frags.Count - 1);
		}
Esempio n. 53
0
		/// -------------------------------------------------------------------------------------
		/// <summary>
		/// Configurer should call this method for each shared subordinate stream (such as
		/// foootnotes) after creating the main stream.
		/// </summary>
		/// <param name="stream">The shared subordinate stream.</param>
		/// <param name="vc">The view constructor to be used for laying out this stream</param>
		/// <param name="subStreamDelegate">Implements view-specific callback methods</param>
		/// -------------------------------------------------------------------------------------
		public void AddSharedSubordinateStream(IVwLayoutStream stream, IVwViewConstructor vc,
			ISubordinateStreamDelegate subStreamDelegate)
		{
			CheckDisposed();

			SubordinateStream subStream;
			subStream.m_fShared = true;
			subStream.m_vc = vc;
			subStream.m_delegate = subStreamDelegate;
			subStream.m_stream = stream;
			// We're not always the manager for the shared stream, but sometimes, and it is
			// better to have a valid object as manager then to get a crash :-)
			subStream.m_stream.SetManager(this);
			m_subStreams.Add(subStream);
		}
Esempio n. 54
0
		/// <summary>
		/// overridden to maintain the frags array.
		/// </summary>
		/// <param name="tag"></param>
		/// <param name="vc"></param>
		/// <param name="frag"></param>
		public override void AddObjVecItems(int tag, IVwViewConstructor vc, int frag)
		{
			m_frags.Add(frag);
			base.AddObjVecItems (tag, vc, frag);
			m_frags.RemoveAt(m_frags.Count - 1);
		}
		public void SetRootObject(int hvo, IVwViewConstructor _vwvc, int frag, IVwStylesheet _ss)
		{
			throw new NotImplementedException();
		}
Esempio n. 56
0
		public override void AddStringProp(int tag, IVwViewConstructor _vwvc)
		{
			if (tag == (int)StTxtPara.StTxtParaTags.kflidContents)
			{
				WriteStringProp(tag, "note", 0);
			}
		}
		public void SetRootString(ITsString _tss, IVwStylesheet _ss, IVwViewConstructor _vwvc,
			int frag)
		{
			throw new NotImplementedException();
		}
Esempio n. 58
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Adds the obj vec.
		/// </summary>
		/// <param name="tag">The tag.</param>
		/// <param name="vc">The vc.</param>
		/// <param name="frag">The frag.</param>
		/// ------------------------------------------------------------------------------------
		public virtual void AddObjVec(int tag, IVwViewConstructor vc, int frag)
		{
			OpenProp(tag);
			vc.DisplayVec(this, m_hvoCurr, tag, frag);
			CloseProp();
		}
Esempio n. 59
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Member AddUnicodeProp
		/// </summary>
		/// <param name="tag">tag</param>
		/// <param name="ws">ws</param>
		/// <param name="_vwvc">_vwvc</param>
		/// ------------------------------------------------------------------------------------
		public virtual void AddUnicodeProp(int tag, int ws, IVwViewConstructor _vwvc)
		{
			OpenProp(tag);
			AddResultString(m_sda.get_UnicodeProp(m_hvoCurr, tag), ws);
			CloseProp();
		}
Esempio n. 60
0
			/*
						/// <summary>
						/// Override to remove the TAB key from treatment as a normal key.
						/// </summary>
						/// <param name="keyData"></param>
						/// <returns>false, if it is a TAB key, otherwise whatever the superclass returns.</returns>
						protected override bool IsInputKey(Keys keyData)
						{
							if (keyData == Keys.Tab)
								return false;
							return base.IsInputKey(keyData);
						}
			*/

			public override void MakeRoot()
			{
				CheckDisposed();
				base.MakeRoot();

				if (m_fdoCache == null || DesignMode)
					return;

				IVwRootBox rootb = VwRootBoxClass.Create();
				rootb.SetSite(this);

				rootb.DataAccess = m_fdoCache.MainCacheAccessor;

				m_vc = m_info.Vc;
				if (m_vc == null)
				{
					if (m_info.DisplayAsContext)
					{
						m_vc = new ContextVc(m_info);
					}
					else
					{
						m_vc = new SummaryVc(m_info);
					}
				}

				// The root object is the one, if any, that the policy gives us.
				// If it doesn't give us one the vc will obtain a key string from the policy
				// directly. The frag argument is arbitrary. Note that we have to use a non-zero
				// HVO, even when it doesn't mean anything, to avoid triggering an Assert in the Views code.
				rootb.SetRootObject(m_info.Hvo == 0 ? 1 : m_info.Hvo, m_vc, 1, m_styleSheet);
				this.m_rootb = rootb;
			}