SIL.FieldWorks.Common.Framework.FwEditingHelper.InsertPicture C# (CSharp) Méthode

InsertPicture() public méthode

Inserts an ORC pointing to hvoObjToInsert at the current selection location. Enhance JohnT: should move this to RootSite or similar location where all clients can readily use it.
public InsertPicture ( ICmPicture pict ) : void
pict ICmPicture The picture to insert
Résultat void
		public void InsertPicture(ICmPicture pict)
		{
			// get selection information
			ITsString tss;
			int ich;
			bool fAssocPrev;
			int hvoObj;
			int ws;
			int propTag;
			SelectionHelper helper = CurrentSelection;
			IVwSelection sel = helper.Selection;
			sel.TextSelInfo(true, out tss, out ich, out fAssocPrev, out hvoObj, out propTag, out ws);

			// If inserting a picture over a user prompt, need to set up info for a proper insertion
			// in the empty paragraph.
			if (propTag == SimpleRootSite.kTagUserPrompt)
			{
				ich = 0;
				ITsStrFactory factory = m_cache.TsStrFactory;
				tss = factory.MakeString(string.Empty, m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.Handle);
				propTag = StTxtParaTags.kflidContents;
				helper.SetTextPropId(SelectionHelper.SelLimitType.Anchor, StTxtParaTags.kflidContents);
				helper.SetTextPropId(SelectionHelper.SelLimitType.End, StTxtParaTags.kflidContents);
			}
			else if (tss == null)
			{
				helper = GetSelectionReducedToIp(SelectionHelper.SelLimitType.Top);
				if (helper != null)
					helper.Selection.TextSelInfo(true, out tss, out ich, out fAssocPrev, out hvoObj, out propTag, out ws);
			}

			if (tss == null)
				throw new InvalidOperationException("Attempt to insert a picture in an invalid location.");

			InsertPictureOrc(pict, tss, ich, hvoObj, propTag, ws);
			helper.IchAnchor = helper.IchEnd = ich + 1;
			helper.SetIPAfterUOW();
		}

Same methods

FwEditingHelper::InsertPicture ( string srcFilename, ITsString captionTss, string sFolder ) : void