本文整理汇总了C#中FwStyleSheet类的典型用法代码示例。如果您正苦于以下问题:C# FwStyleSheet类的具体用法?C# FwStyleSheet怎么用?C# FwStyleSheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FwStyleSheet类属于命名空间,在下文中一共展示了FwStyleSheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: 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);
}
示例3: ImportDialog
///-------------------------------------------------------------------------------
/// <summary>
/// Constructor for import dialog, requiring a language project.
/// Use this constructor at run time.
/// </summary>
///-------------------------------------------------------------------------------
public ImportDialog(FwStyleSheet styleSheet, FdoCache cache, IScrImportSet settings,
IHelpTopicProvider helpTopicProvider, IApp app) : this()
{
m_StyleSheet = styleSheet;
m_helpTopicProvider = helpTopicProvider;
m_app = app;
m_scr = cache.LangProject.TranslatedScriptureOA;
m_importSettings = settings;
//InitBookNameList();
// Set the initial values for the controls from the static variables.
radImportEntire.Checked = ImportEntire;
radImportRange.Checked = !ImportEntire;
chkTranslation.Checked = ImportTranslation;
chkBackTranslation.Checked = ImportBackTranslation;
chkBookIntros.Checked = ImportBookIntros;
chkOther.Checked = ImportAnnotations;
// Restore any saved settings.
if (s_StartRef != null)
StartRef = s_StartRef;
else
SetStartRefToFirstImportableBook();
if (s_EndRef != null)
EndRef = s_EndRef;
else
SetEndRefToLastImportableBook();
// Finish constructing the ScrBookControl objects.
InitializeStartAndEndRefControls();
}
示例4: DummyTeImporter
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor to use when using an in-memory cache
/// </summary>
/// <param name="settings">Import settings</param>
/// <param name="cache">FDO Cache</param>
/// <param name="styleSheet">A stylesheet</param>
/// <param name="inMemoryCache"> in-memory cache (use null to test against real DB)</param>
/// ------------------------------------------------------------------------------------
public DummyTeImporter(ScrImportSet settings, FdoCache cache, FwStyleSheet styleSheet,
ScrInMemoryFdoCache inMemoryCache) :
base(settings, cache, styleSheet, new DummyUndoImportManager(inMemoryCache),
new TeImportNoUi())
{
m_inMemoryCache = inMemoryCache;
}
示例5: Initialize
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes the list of style proxies.
/// </summary>
/// <param name="styleSheet">The style sheet.</param>
/// ------------------------------------------------------------------------------------
public static void Initialize(FwStyleSheet styleSheet)
{
if (s_styleProxies == null)
s_styleProxies = new Dictionary<string, ImportStyleProxy>();
s_styleSheet = styleSheet;
}
示例6: DummyImportWizard
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="DummyImportWizard"/> class.
/// </summary>
/// <param name="cache">The database cache.</param>
/// <param name="scr">The Scripture object.</param>
/// <param name="styleSheet">The style sheet.</param>
/// ------------------------------------------------------------------------------------
public DummyImportWizard(FdoCache cache, Scripture scr,
FwStyleSheet styleSheet) :
base("LANG. PROJ. TEST NAME.", scr, styleSheet, cache)
{
m_lvCurrentMappingList = lvScrMappings;
m_btnCurrentModifyButton = m_btnModifyScrMapping;
m_btnCurrentDeleteButton = m_btnDeleteScrMapping;
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: KeyTermsViewWrapper
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructs a KeyTermsViewWrapper
/// </summary>
/// <param name="parent">The parent of the split wrapper (can be null). Will be replaced
/// with real parent later.</param>
/// <param name="cache">The Cache to give to the views</param>
/// <param name="draftViewProxy">View proxy for creating the draft view to display in
/// the lower right corner</param>
/// <param name="settingsRegKey">The parent control's ISettings registry key</param>
/// <param name="bookFilterInstance">The book filter instance.</param>
/// <param name="sProjectName">The name of the current project</param>
/// <param name="stylesheet">The stylesheet.</param>
/// <param name="helpTopicProvider">The help topic provider.</param>
/// ------------------------------------------------------------------------------------
public KeyTermsViewWrapper(Control parent, FdoCache cache, ViewProxy draftViewProxy,
RegistryKey settingsRegKey, int bookFilterInstance, string sProjectName,
FwStyleSheet stylesheet, IHelpTopicProvider helpTopicProvider)
: base(parent, cache, draftViewProxy, settingsRegKey)
{
m_bookFilterInstance = bookFilterInstance;
Name = "KeyTermsViewWrapper";
// Set up the right view
m_rightView.Name = "KeyTermsRightView";
m_sProjectName = sProjectName;
m_stylesheet = stylesheet;
m_helpTopicProvider = helpTopicProvider;
}
示例11: CharacterMappingSettings
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor for runtime.
/// </summary>
/// <param name="mapping">Provides intial values displayed in dialog.</param>
/// <param name="styleSheet">Provides the character styles user can pick from.</param>
/// <param name="cache">The DB cache</param>
/// <param name="fIsAnnotation">if set to <c>true</c> the current tab is for
/// annotations.</param>
/// <param name="helpTopicProvider">The help topic provider.</param>
/// <param name="app">The application</param>
/// ------------------------------------------------------------------------------------
public CharacterMappingSettings(ImportMappingInfo mapping, FwStyleSheet styleSheet,
FdoCache cache, bool fIsAnnotation, IHelpTopicProvider helpTopicProvider, IApp app) :
this()
{
m_resources = new ResourceManager("SIL.FieldWorks.TE.ScrImportComponents",
Assembly.GetExecutingAssembly());
m_cache = cache;
m_helpTopicProvider = helpTopicProvider;
m_app = app;
m_styleSheet = styleSheet;
InitializeControls(mapping, fIsAnnotation);
}
示例12: 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;
}
示例13: 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;
}
示例14: 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);
}
示例15: Create
/// ------------------------------------------------------------------------------------
/// <summary>
/// Method to test creation of a publication view.
/// </summary>
/// <param name="pub">The publication.</param>
/// <param name="viewType">Type of the Translation Editor view.</param>
/// <returns>
/// a Scripture publication for the specified view type.
/// </returns>
/// ------------------------------------------------------------------------------------
internal static DummyScripturePublication Create(IPublication pub,
TeViewType viewType, FwStyleSheet stylesheet)
{
if (viewType == TeViewType.BackTranslationParallelPrint)
{
Debug.Assert(false, "Not yet implemented.");
return null;
}
DummyScripturePublication pubControl = new DummyScripturePublication(pub.Cache,
stylesheet, 567, pub, viewType, DateTime.Now);
pubControl.Anchor = AnchorStyles.Top | AnchorStyles.Left |
AnchorStyles.Right | AnchorStyles.Bottom;
pubControl.Dock = DockStyle.Fill;
pubControl.Name = TeEditingHelper.ViewTypeString(viewType);
pubControl.Visible = false;
return pubControl;
}