예제 #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initialize the object with some useful information, and write the initial
		/// element start tag to the output.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="w">The w.</param>
		/// <param name="sDataType">Type of the s data.</param>
		/// <param name="sFormat">The s format.</param>
		/// <param name="sOutPath">The s out path.</param>
		/// ------------------------------------------------------------------------------------
		public void Initialize(FdoCache cache, TextWriter w, string sDataType, string sFormat,
			string sOutPath)
		{
			m_writer = w;
			m_strm = new TextWriterStream(w);
			m_cache = cache;
			m_sFormat = sFormat.ToLowerInvariant();
			m_fUseRFC4646 = m_sFormat == "xhtml" || m_sFormat == "lift";
			m_xhtml = new XhtmlHelper(w, cache);
			if (m_sFormat == "xhtml")
			{
				m_xhtml.WriteXhtmlHeading(sOutPath, null, "dicBody");
			}
			else
			{
				w.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
				w.WriteLine("<{0}>", sDataType);
			}
		}
예제 #2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initialize the object with some useful information, and write the initial
		/// element start tag to the output.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public void Initialize(FdoCache cache, Mediator mediator, TextWriter w, string sDataType,
			string sFormat, string sOutPath, string sBodyClass)
		{
			m_writer = w;
			m_strm = new TextWriterStream(w);
			m_cache = cache;
			m_mediator = mediator;
			m_stylesheet = Widgets.FontHeightAdjuster.StyleSheetFromMediator(m_mediator);
			m_mdc = cache.MetaDataCacheAccessor;
			m_sFormat = sFormat.ToLowerInvariant();
			if (m_sFormat == "xhtml")
			{
				m_xhtml = new XhtmlHelper(w, cache);
				m_xhtml.WriteXhtmlHeading(sOutPath, null, sBodyClass);
			}
			else
			{
				w.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
				w.WriteLine("<{0}>", sDataType);
			}
			m_cssType = (sBodyClass == "notebookBody") ?
				XhtmlHelper.CssType.Notebook : XhtmlHelper.CssType.Dictionary;
		}