Example #1
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// When the state of the overlays changes, it propagates this to its site.
		/// </summary>
		/// <param name="prootb"></param>
		/// <param name="vo"></param>
		/// -----------------------------------------------------------------------------------
		void IVwRootSite.OverlayChanged(IVwRootBox prootb, IVwOverlay vo)
		{
			// Do nothing for printing
		}
Example #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Member OverlayChanged
		/// </summary>
		/// <param name="_Root">_Root</param>
		/// <param name="_vo">_vo</param>
		/// ------------------------------------------------------------------------------------
		public void OverlayChanged(IVwRootBox _Root, IVwOverlay _vo)
		{
			CheckDisposed();

			// TODO:  Add PublicationControl.OverlayChanged implementation
		}
Example #3
0
		public void ModifyOverlay(bool fApplyTag, IVwOverlay pvo, int itag)
		{
			CheckDisposed();
			if (m_rootb == null)
				return;

			Debug.WriteLine("WARNING: RootSite.ModifyOverlay() isn't tested yet");
			int hvo;
			uint clrFore;
			uint clrBack;
			uint clrUnder;
			int unt;
			bool fHidden;
			string uid;
			using (ArrayPtr arrayPtr = MarshalEx.StringToNative((int)VwConst1.kcchGuidRepLength + 1, true))
			{
				pvo.GetDbTagInfo(itag, out hvo, out clrFore, out clrBack, out clrUnder, out unt,
					out fHidden, arrayPtr);
				uid = MarshalEx.NativeToString(arrayPtr,
					(int)VwConst1.kcchGuidRepLength, false);
			}

			IVwSelection vwsel;
			ITsTextProps[] vttp;
			IVwPropertyStore[] vvps;
			if (EditingHelper.GetCharacterProps(out vwsel, out vttp, out vvps))
			{
				int cttp = vttp.Length;
				for (int ittp = 0; ittp < cttp; ittp++)
				{
					string strGuid = vttp[ittp].GetStrPropValue(
						(int)FwTextPropType.ktptTags);

					// REVIEW (EberhardB): I'm not sure if this works
					int cGuids = strGuid.Length / Marshal.SizeOf(typeof(Guid));
					List<string> guids = new List<string>();
					for (int i = 0; i < cGuids; i++)
						guids.Add(strGuid.Substring(i, Marshal.SizeOf(typeof(Guid))));

					if (fApplyTag)
					{
						// Add the tag if it does not exist
						if (guids.BinarySearch(uid) >= 0)
						{
							// The tag has already been applied to the textprop, so it doesn't
							// need to be modified.
							vttp[ittp] = null;
							continue;
						}
						else
						{
							// We need to add the tag to the textprop.
							guids.Add(uid);
							guids.Sort();
						}
					}
					else
					{
						// Remove the tag from the textprop.
						guids.Remove(uid);
					}

					ITsPropsBldr tpb = vttp[ittp].GetBldr();
					tpb.SetStrPropValue((int)FwTextPropType.ktptTags,
						guids.ToString());

					vttp[ittp] = tpb.GetTextProps();
				}
				vwsel.SetSelectionProps(cttp, vttp);

				/*
				 * ENHANCE (EberhardB): Implement this if we need it. It probably should be
				 * implemented in a derived class (view class for DataNotebook?)
				// Update the RnGenericRec_PhraseTags table as necessary.
				// (Yes, this is special case code!)

				AfDbInfo * pdbi = NULL;
				AfMainWnd * pamw = m_pwndSubclass->MainWindow();
				if (pamw)
				{
					AfMdiMainWnd * pammw = dynamic_cast<AfMdiMainWnd *>(pamw);
					AfLpInfo * plpi = NULL;
					if (pammw)
					{
						plpi = pammw->GetLpInfo();
						if (plpi)
							pdbi = plpi->GetDbInfo();
					}
				}
				if (pdbi)
				{
					int clevEnd;
					int clevAnchor;
					HVO hvoEnd;
					HVO hvoAnchor;
					PropTag tagEnd;
					PropTag tagAnchor;
					int ihvo;
					int cpropPrev;
					IVwPropertyStorePtr qvps;
					CheckHr(qvwsel->CLevels(true, &clevEnd));
					Assert(clevEnd >= 1);
					CheckHr(qvwsel->CLevels(false, &clevAnchor));
					Assert(clevAnchor >= 1);
					CheckHr(qvwsel->PropInfo(true, clevEnd - 1, &hvoEnd, &tagEnd, &ihvo,
						&cpropPrev, &qvps));
					CheckHr(qvwsel->PropInfo(false, clevAnchor - 1, &hvoAnchor, &tagAnchor, &ihvo,
						&cpropPrev, &qvps));

					IOleDbEncapPtr qode;
					pdbi->GetDbAccess(&qode);
				DbStringCrawler::UpdatePhraseTagsTable(kflidRnGenericRec_PhraseTags, fApplyTag, qode,
									 hvo, hvoEnd, hvoAnchor);
				}
				*/
			}
			if (FindForm() == Form.ActiveForm)
				Focus();
		}
Example #4
0
 /// -----------------------------------------------------------------------------------
 /// <summary>
 /// When the state of the overlays changes, it propagates this to its site.
 /// </summary>
 /// <param name="prootb"></param>
 /// <param name="vo"></param>
 /// -----------------------------------------------------------------------------------
 void IVwRootSite.OverlayChanged(IVwRootBox prootb, IVwOverlay vo)
 {
     // Do nothing for printing
 }
Example #5
0
		/// -----------------------------------------------------------------------------------
		/// <summary>
		/// When the state of the overlays changes, it propagates this to its site.
		/// </summary>
		/// <param name="prootb"></param>
		/// <param name="vo"></param>
		/// -----------------------------------------------------------------------------------
		public virtual void OverlayChanged(IVwRootBox prootb, IVwOverlay vo)
		{
			CheckDisposed();
			// do nothing
		}