当前位置: 首页>>代码示例>>C#>>正文


C# FwStyleSheet.Init方法代码示例

本文整理汇总了C#中FwStyleSheet.Init方法的典型用法代码示例。如果您正苦于以下问题:C# FwStyleSheet.Init方法的具体用法?C# FwStyleSheet.Init怎么用?C# FwStyleSheet.Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FwStyleSheet的用法示例。


在下文中一共展示了FwStyleSheet.Init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTestData

		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected override void CreateTestData()
		{
			m_stylesheet = new FwStyleSheet();
			m_stylesheet.Init(Cache, m_scr.Hvo, ScriptureTags.kflidStyles);

			m_exodus = AddBookToMockedScripture(2, "Exodus");
			AddTitleToMockedBook(m_exodus, "Exodus");

			IScrSection section = AddSectionToMockedBook(m_exodus);
			AddSectionHeadParaToSection(section, "Section Heading", ScrStyleNames.SectionHead);
			IScrTxtPara para = AddParaToMockedSectionContent(section, ScrStyleNames.NormalParagraph);
			AddRunToMockedPara(para, "1", ScrStyleNames.ChapterNumber);
			AddRunToMockedPara(para, "1", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse one. ", null);
			AddRunToMockedPara(para, "2", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse two.", null);
			AddRunToMockedPara(para, "3", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse three.", null);
			AddRunToMockedPara(para, "4", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse four. ", null);
			AddRunToMockedPara(para, "5", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse five.", null);
			AddRunToMockedPara(para, "6", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse six. ", null);
			AddRunToMockedPara(para, "7", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse seven.", null);
			AddRunToMockedPara(para, "8", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse seven.", null);
			AddRunToMockedPara(para, "9", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse seven.", null);
			AddRunToMockedPara(para, "10", ScrStyleNames.VerseNumber);
			AddRunToMockedPara(para, "Verse seven.", null);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:38,代码来源:ScripturePropertiesTests.cs

示例2: FwApplyStyleDlg

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FwApplyStyleDlg"/> class.
		/// </summary>
		/// <param name="rootSite">The root site.</param>
		/// <param name="cache">The cache.</param>
		/// <param name="hvoStylesOwner">The hvo of the object which owns the style.</param>
		/// <param name="stylesTag">The "flid" in which the styles are owned.</param>
		/// <param name="normalStyleName">Name of the normal style.</param>
		/// <param name="customUserLevel">The custom user level.</param>
		/// <param name="paraStyleName">Name of the currently selected paragraph style.</param>
		/// <param name="charStyleName">Name of the currently selected character style.</param>
		/// <param name="hvoRootObject">The hvo of the root object in the current view.</param>
		/// <param name="app">The application.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public FwApplyStyleDlg(IVwRootSite rootSite, FdoCache cache, int hvoStylesOwner,
			int stylesTag, string normalStyleName, int customUserLevel, string paraStyleName,
			string charStyleName, int hvoRootObject, IApp app,
			IHelpTopicProvider helpTopicProvider)
		{
			m_rootSite = rootSite;
			InitializeComponent();
			m_customUserLevel = customUserLevel;
			m_helpTopicProvider = helpTopicProvider;
			m_paraStyleName = paraStyleName;
			m_charStyleName = charStyleName;

			// Cache is null in tests
			if (cache == null)
				return;

			m_cboTypes.SelectedIndex = 1; // All Styles

			// Load the style information
			m_styleTable = new StyleInfoTable(normalStyleName,
				cache.ServiceLocator.WritingSystemManager);
			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(cache, hvoStylesOwner, stylesTag);
			m_styleListHelper = new StyleListBoxHelper(m_lstStyles);
			m_styleListHelper.ShowInternalStyles = false;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:42,代码来源:FwApplyStyleDlg.cs

示例3: TestSetup

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initialize the FDO cache and open database
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void TestSetup()
		{
			base.TestSetup();

			m_stylesheet = new FwStyleSheet();
			m_stylesheet.Init(Cache, m_scr.Hvo, ScriptureTags.kflidStyles);

			StyleProxyListManager.Initialize(m_stylesheet);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:14,代码来源:TeAnnotationXmlImportTests.cs

示例4: TestSetup

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Set up Undo action and initialize the stylesheet
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void TestSetup()
		{
			base.TestSetup();

			m_styleSheet = new FwStyleSheet();
			// Force load of styles
			IScripture scr = Cache.LangProject.TranslatedScriptureOA;
			Assert.IsTrue(scr.StylesOC.Count > 0);
			m_styleSheet.Init(Cache, scr.Hvo, ScriptureTags.kflidStyles);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:15,代码来源:ImportStyleProxyTests.cs

示例5: Initialize

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initialize the FDO cache and open database
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void Initialize()
		{
			base.Initialize();

			m_scrInMemoryCache.InitializeWritingSystemEncodings();
			m_scrInMemoryCache.InitializeAnnotationDefs();
			m_scrInMemoryCache.InitializeScrAnnotationCategories();
			m_stylesheet = new FwStyleSheet();
			m_stylesheet.Init(Cache, m_scr.Hvo, (int)Scripture.ScriptureTags.kflidStyles);

			StyleProxyListManager.Initialize(m_stylesheet);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:17,代码来源:TeAnnotationXmlImportTests.cs

示例6: TestSetup

		public override void TestSetup()
		{
			base.TestSetup();

			var styleSheet = new FwStyleSheet();
			styleSheet.Init(Cache, m_scr.Hvo, ScriptureTags.kflidStyles);

			Debug.Assert(m_basicView == null, "m_basicView is not null.");
			//if (m_basicView != null)
			//	m_basicView.Dispose();
			m_basicView = CreateDummyBasicView();
			m_basicView.Cache = Cache;
			m_basicView.Visible = false;
			m_basicView.StyleSheet = styleSheet;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:15,代码来源:BasicViewTestsBase.cs

示例7: Initialize

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

			FwStyleSheet styleSheet = new FwStyleSheet();
			styleSheet.Init(Cache, m_scr.Hvo, (int)Scripture.ScriptureTags.kflidStyles);

			Debug.Assert(m_basicView == null, "m_basicView is not null.");
			//if (m_basicView != null)
			//	m_basicView.Dispose();
			m_basicView = CreateDummyBasicView();
			m_basicView.Cache = Cache;
			m_basicView.Visible = false;
			m_basicView.StyleSheet = styleSheet;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:16,代码来源:BasicViewTestsBase.cs

示例8: Initialize

		public override void Initialize()
		{
			base.Initialize();

			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(Cache, m_scr.Hvo, (int)Scripture.ScriptureTags.kflidStyles);
			InitWsInfo();
			m_undoImportManager = new UndoImportManager(Cache, null);
			m_importer = ReflectionHelper.CreateObject("TeImportExport.dll",
				"SIL.FieldWorks.TE.TeXmlImporter", BindingFlags.NonPublic,
				new object[] {Cache, m_styleSheet, " ", m_undoImportManager,
				m_teImportUi}) as TeXmlImporter;

			ReflectionHelper.CallMethod(m_importer, "Initialize", null);
			m_stackSectionType = ReflectionHelper.GetField(m_importer, "m_stackSectionType") as Stack<string>;

			StyleProxyListManager.Initialize(m_styleSheet);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:18,代码来源:TeXmlImportTests.cs

示例9: TestSetup

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Test setup
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public override void TestSetup()
		{
			base.TestSetup();
			m_fileName = FileUtils.GetTempFile("tmp");
			FileUtils.Delete(m_fileName);	// exporter pops up dialog if file exists!
			m_stylesheet = new FwStyleSheet();
			m_stylesheet.Init(Cache, m_scr.Hvo, ScriptureTags.kflidStyles);

			m_book = AddBookToMockedScripture(1, "Genesis");
			AddTitleToMockedBook(m_book, "Genesis");

			m_filter = Cache.ServiceLocator.GetInstance<IFilteredScrBookRepository>().GetFilterInstance(123);

			m_filter.ShowAllBooks();

			m_exporter = new ExportXhtml(m_fileName, Cache, m_filter, ExportWhat.AllBooks, 1, 0, 0,
				string.Empty, m_stylesheet, null, null);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:23,代码来源:ExportXhtmlTests.cs

示例10: CreateTestData

		protected override void CreateTestData()
		{
			m_lp = Cache.LanguageProject;

			AddTestStyle("Normal", ContextValues.Internal, StructureValues.Undefined,
				FunctionValues.Prose, false, m_lp.StylesOC);
			AddTestStyle("Paragraph", ContextValues.Text, StructureValues.Body,
				FunctionValues.Prose, false, m_lp.StylesOC);
			AddTestStyle("Section Head", ContextValues.Text, StructureValues.Heading,
				FunctionValues.Prose, false, m_lp.StylesOC);
			AddTestStyle("Verse Number", ContextValues.Text, StructureValues.Body,
				FunctionValues.Verse, true, m_lp.StylesOC);
			AddTestStyle("Title Main", ContextValues.Title, StructureValues.Body,
				FunctionValues.Prose, false, m_lp.StylesOC);
			AddTestStyle("Note General Paragraph", ContextValues.Note, StructureValues.Undefined,
				FunctionValues.Prose, false, m_lp.StylesOC);
			AddTestStyle("Note Marker", ContextValues.Internal, StructureValues.Undefined,
				FunctionValues.Prose, true, m_lp.StylesOC);
			AddTestStyle(kStyleName, ContextValues.Text, StructureValues.Body,
				FunctionValues.Prose, true, 2, m_lp.StylesOC);

			// Setup the stylesheet.
			var captionStyle = AddTestStyle("Caption", ContextValues.Internal,
				StructureValues.Body, FunctionValues.Prose, false,
				m_lp.StylesOC);
			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(Cache, m_lp.Hvo,
				LangProjectTags.kflidStyles);

			Debug.Assert(m_stylesComboBox == null, "m_stylesComboBox is not null.");
			//if (m_stylesComboBox != null)
			//	m_stylesComboBox.Dispose();
			m_stylesComboBox = new ComboBox();
			m_styleListHelper = new StyleComboListHelper(m_stylesComboBox);

			// Set the options to display all of the styles
			m_styleListHelper.MaxStyleLevel = int.MaxValue;
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:38,代码来源:StylesComboTests.cs

示例11: Initialize

		public override void Initialize()
		{
			base.Initialize();

			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(Cache, m_scr.Hvo, (int)Scripture.ScriptureTags.kflidStyles);
			InitWsInfo();

			DummyTeImporter.s_translatorNoteDefn = m_scrInMemoryCache.m_translatorNoteDefn;
			DummyTeImporter.s_consultantNoteDefn = m_scrInMemoryCache.m_consultantNoteDefn;

			m_titus = new BCVRef(56001001);
			m_settings = new DummyScrImportSet();
			m_scr.ImportSettingsOC.Add(m_settings);
			m_settings.ImportTypeEnum = TypeOfImport.Other;
			m_settings.StartRef = m_titus;
			m_settings.EndRef = m_titus;
			m_settings.ImportTranslation = true;
			InitializeImportSettings();

			m_importer = new DummyTeImporter(m_settings, Cache, m_styleSheet, m_scrInMemoryCache);
			m_importer.Initialize();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:TeImportTestsBase.cs

示例12: Init

		public void Init()
		{
			m_cache = FdoCache.Create("TestLangProj");
			m_Scripture = m_cache.LangProject.TranslatedScriptureOA;
			// Make sure we don't call InstallLanguage during tests.
			m_cache.LanguageWritingSystemFactoryAccessor.BypassInstall = true;

			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(m_cache, m_Scripture.Hvo, (int)Scripture.ScriptureTags.kflidStyles);

			m_mapping = new ImportMappingInfo("emph{", "}", "Emphasis");
			Options.ShowTheseStylesSetting = Options.ShowTheseStyles.All;
			m_dialog = new DummyCharacterMappingSettings(m_mapping, m_styleSheet, m_cache);
			m_dialog.StyleListHelper.MaxStyleLevel = int.MaxValue;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:15,代码来源:CharacterMappingSettingsTests.cs

示例13: CreateTestData

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Create basic data for the book of Philemon.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		protected override void CreateTestData()
		{
			m_scrInMemoryCache.InitializeScripture();
			m_scrInMemoryCache.InitializeWritingSystemEncodings();

			m_phm = m_scrInMemoryCache.AddBookToMockedScripture(57, "Fylemon");
			m_scrInMemoryCache.AddTitleToMockedBook(m_phm.Hvo, "Fylemon");
			IScrSection section = m_scrInMemoryCache.AddSectionToMockedBook(m_phm.Hvo);
			m_scrInMemoryCache.AddSectionHeadParaToSection(section.Hvo, "Section Heading", ScrStyleNames.SectionHead);
			section.AdjustReferences();

			m_stylesheet = new FwStyleSheet();
			m_stylesheet.Init(Cache, m_scr.Hvo, (int)Scripture.ScriptureTags.kflidStyles);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:19,代码来源:BookPropertiesTests.cs

示例14: ConfigurePublication

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Configure a PublicationControl
		/// </summary>
		/// <param name="fAddSubStream">if set to <c>true</c> add subordinate stream.</param>
		/// <param name="fAddContent">if set to <c>true</c> add real content, otherwise add
		/// rectangle for paragraph.</param>
		/// ------------------------------------------------------------------------------------
		private void ConfigurePublication(bool fAddSubStream, bool fAddContent)
		{
			// When called for test setup, they will be null.
			// When called from within as test
			if (m_ScrPubCtrl != null)
				m_ScrPubCtrl.Dispose();
			if (m_division != null)
				m_division.Dispose();
			m_division = new DummyDivision(new DummyLazyPrintConfigurer(Cache, fAddSubStream,
				fAddContent), 1);

			FwStyleSheet styleSheet = new FwStyleSheet();
			styleSheet.Init(Cache, Cache.LangProject.TranslatedScriptureOAHvo,
				(int)Scripture.ScriptureTags.kflidStyles);

			FootnoteVc footnoteVc = new FootnoteVc(-1, TeStVc.LayoutViewTarget.targetPrint,
				Cache.DefaultVernWs);
			footnoteVc.Cache = Cache;
			footnoteVc.Stylesheet = styleSheet;

			DummyPrintConfigurer configurer = m_division.Configurer as DummyPrintConfigurer;
			configurer.RootOnEachPage = true;
			configurer.DependentRootFrag = (int)FootnoteFrags.kfrRootInPageSeq;
			configurer.DependentRootTag = DummyVirtualHandler.InstallDummyHandler(Cache.VwCacheDaAccessor,
					"Scripture", "FootnotesOnPage", (int)CellarModuleDefns.kcptReferenceSequence).Tag;
			configurer.StyleSheet = styleSheet;
			configurer.DependentRootVc = footnoteVc;

			m_dbPub = new Publication(Cache,
				Cache.LangProject.TranslatedScriptureOA.PublicationsOC.HvoArray[0]);
			m_dbPub.BaseFontSize = 12;
			m_dbPub.BaseLineSpacing = 15;
			PubDivision pubDiv = new PubDivision();
			m_dbPub.DivisionsOS.Append(pubDiv);
			pubDiv.PageLayoutOA = new PubPageLayout();
			pubDiv.NumColumns = 1;
			pubDiv.StartAt = DivisionStartOption.NewPage;

			m_ScrPubCtrl = new DummyScripturePublicationNoDb(m_dbPub, styleSheet, m_division, DateTime.Now,
				m_filterInstance);

			m_ScrPubCtrl.IsLeftBound = true;

			// Set up the publication
			m_ScrPubCtrl.PageHeight = 72000 * 11; // 11 inches
			m_ScrPubCtrl.PageWidth = (int)(72000 * 8.5); // 8.5 inches
			m_division.TopMargin = 36000; // Half inch
			m_division.BottomMargin = 18000; // Quarter inch
			m_division.InsideMargin = 9000; // 1/8 inch
			m_division.OutsideMargin = 4500; // 1/16 inch
			m_ScrPubCtrl.Width = 3 * 96; // represents a window that is 3" wide at 96 DPI
			m_ScrPubCtrl.Configure();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:61,代码来源:TePrintLayoutTests.cs

示例15: SetStyleSheet

		private void SetStyleSheet(int hvo)
		{
			var text = hvo == 0 ? null : (IStText)Cache.ServiceLocator.GetObject(hvo);

			IVwStylesheet wantedStylesheet = m_styleSheet;
			if (text != null && ScriptureServices.ScriptureIsResponsibleFor(text))
			{
				// Use the Scripture stylesheet
				if (m_teStylesheet == null)
				{
					m_flexStylesheet = m_styleSheet; // remember the default.
					var stylesheet = new FwStyleSheet();
					stylesheet.Init(Cache, Cache.LangProject.TranslatedScriptureOA.Hvo, ScriptureTags.kflidStyles);
					m_teStylesheet = stylesheet;
				}
				wantedStylesheet = m_teStylesheet;
			}
			else if (m_flexStylesheet != null)
			{
				wantedStylesheet = m_flexStylesheet;
			}
			if (wantedStylesheet != m_styleSheet)
			{
				m_styleSheet = wantedStylesheet;
				// Todo: set up the comobo; set the main window one.
			}
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:27,代码来源:RawTextPane.cs


注:本文中的FwStyleSheet.Init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。