コード例 #1
0
ファイル: FontsStylesForm.cs プロジェクト: sillsdev/WorldPad
		protected XPathIterator GetIteratorFromMap(string strFontName, IteratorMap mapNames2Iterator)
		{
			return mapNames2Iterator[strFontName];
		}
コード例 #2
0
ファイル: FontsStylesForm.cs プロジェクト: sillsdev/WorldPad
		public bool ConvertDoc(string strFontStyleName, IteratorMap mapIterators,
			string strLhsFont, Font fontApply, bool bConvertCharValue)
		{
			bool bModified = false;
			if (IsConverterDefined(strFontStyleName))
			{
				DirectableEncConverter aEC = GetConverter(strFontStyleName);
				XPathIterator xpIteratorFontStyleText = mapIterators[strFontStyleName];
				Font fontLhs = CreateFontSafe(strLhsFont);
				bModified = SetValues(xpIteratorFontStyleText, strFontStyleName, aEC,
					fontLhs, fontApply, bConvertCharValue);
			}
			return bModified;
		}
コード例 #3
0
ファイル: DocXmlDocument.cs プロジェクト: sillsdev/WorldPad
		public bool GetTextIteratorForName(string strFontNameOrStyleId, string strXPathFormat,
			ref IteratorMap mapNames2Iterator, bool bConvertAsCharValue)
		{
			bool bAdded = false;
#if !rde1001
			// before creating and adding this one, make sure it isn't a duplicate (which
			//	can now only happen if the same font is found in two different documents).
			//	It's okay that we'll ignore it in subsequent documents, because before we
			//	convert the files, we re-query for all of them
			if (!mapNames2Iterator.ContainsKey(strFontNameOrStyleId))
			{
				// get an iterator to see if there's any actual data in this font in this document
				//  (and don't add it here if not)
				string strXPathText = String.Format(strXPathFormat, strFontNameOrStyleId);
				XPathNodeIterator xpIteratorFontText = GetIterator(strXPathText);
				if ((bAdded = xpIteratorFontText.MoveNext()))
					mapNames2Iterator.Add(strFontNameOrStyleId, new XPathIterator(xpIteratorFontText, bConvertAsCharValue));
			}
			else
				System.Diagnostics.Debug.Assert(!Program.IsOnlyOneDoc, "Bad assumption: multiple fonts found for the same type of text and *not* because it's multiple documents! Send this document to [email protected] for help");
#else
			if (!mapNames2Iterator.ContainsKey(strFontNameOrStyleId))
			{
				// get an iterator to see if there's any actual data in this font in this document
				//  (and don't add it here if not)
				string strXPathText = String.Format(strXPathFormat, strFontNameOrStyleId);
				XPathNodeIterator xpIteratorFontText = GetIterator(strXPathText);
				if ((bAdded = xpIteratorFontText.MoveNext()))
				{
					mapNames2Iterator.Add(strFontNameOrStyleId, xpIteratorFontText);
				}
			}
#endif

			return bAdded;
		}