本文整理汇总了C#中IVwStylesheet类的典型用法代码示例。如果您正苦于以下问题:C# IVwStylesheet类的具体用法?C# IVwStylesheet怎么用?C# IVwStylesheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVwStylesheet类属于命名空间,在下文中一共展示了IVwStylesheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleMatchDlg
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="T:SimpleMatchDlg"/> class.
/// </summary>
/// <param name="wsf">The WSF.</param>
/// <param name="ws">The ws.</param>
/// <param name="ss">The ss.</param>
/// ------------------------------------------------------------------------------------
public SimpleMatchDlg(ILgWritingSystemFactory wsf, int ws, IVwStylesheet ss)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
// We do this outside the designer-controlled code because it does funny things
// to FwTextBoxes, owing to the need for a writing system factory, and some
// properties it should not persist but I can't persuade it not to.
this.m_textBox = new FwTextBox();
this.m_textBox.WritingSystemFactory = wsf; // set ASAP.
this.m_textBox.WritingSystemCode = ws;
this.m_textBox.StyleSheet = ss; // before setting text, otherwise it gets confused about height needed.
this.m_textBox.Location = new System.Drawing.Point(8, 24);
this.m_textBox.Name = "m_textBox";
this.m_textBox.Size = new System.Drawing.Size(450, 32);
this.m_textBox.TabIndex = 0;
this.m_textBox.Text = "";
this.Controls.Add(this.m_textBox);
regexContextMenu = new RegexHelperMenu(m_textBox, FwApp.App);
m_ivwpattern = VwPatternClass.Create();
helpProvider = new System.Windows.Forms.HelpProvider();
helpProvider.HelpNamespace = FwApp.App.HelpFile;
helpProvider.SetHelpKeyword(this, FwApp.App.GetHelpString(s_helpTopic, 0));
helpProvider.SetHelpNavigator(this, System.Windows.Forms.HelpNavigator.Topic);
}
示例2: Initialize
public void Initialize(FdoCache cache, IHelpTopicProvider helpTopicProvider,
IApp app, IVwStylesheet stylesheet, NotebookImportWiz.CharMapping charMapping)
{
m_cache = cache;
m_helpTopicProvider = helpTopicProvider;
m_app = app;
m_stylesheet = stylesheet;
if (charMapping == null)
{
m_tbBeginMkr.Text = String.Empty;
m_tbEndMkr.Text = String.Empty;
m_rbEndOfWord.Checked = false;
m_rbEndOfField.Checked = true;
FillWritingSystemCombo(null);
FillStylesCombo(null);
m_chkIgnore.Checked = false;
}
else
{
m_tbBeginMkr.Text = charMapping.BeginMarker;
m_tbEndMkr.Text = charMapping.EndMarker;
m_rbEndOfWord.Checked = charMapping.EndWithWord;
m_rbEndOfField.Checked = !charMapping.EndWithWord;
FillWritingSystemCombo(charMapping.DestinationWritingSystemId);
FillStylesCombo(charMapping.DestinationStyle);
m_chkIgnore.Checked = charMapping.IgnoreMarkerOnImport;
}
}
示例3: TryAWordSandbox
/// <summary>
/// Create a new one.
/// </summary>
/// <param name="cache"></param>
/// <param name="ss"></param>
/// <param name="choices"></param>
/// <param name="analysis"></param>
/// <param name="mediator"></param>
public TryAWordSandbox(FdoCache cache, Mediator mediator, IVwStylesheet ss, InterlinLineChoices choices,
IAnalysis analysis)
: base(cache, mediator, ss, choices)
{
SizeToContent = true;
LoadForWordBundleAnalysis(analysis.Hvo);
}
示例4: BookPropertiesDialog
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="BookPropertiesDialog"/> class.
/// </summary>
/// <param name="book">the current book</param>
/// <param name="stylesheet">The stylesheet.</param>
/// ------------------------------------------------------------------------------------
public BookPropertiesDialog(IScrBook book, IVwStylesheet stylesheet)
{
m_currentBook = book;
// TE-5663: make sure the book's name and abbreviation are updated if some were added
book.Name.CopyAlternatives(
((ScrBookRef)book.Cache.ScriptureReferenceSystem.BooksOS[book.CanonicalNum - 1]).BookName, true);
book.Abbrev.CopyAlternatives(
((ScrBookRef)book.Cache.ScriptureReferenceSystem.BooksOS[book.CanonicalNum - 1]).BookAbbrev, true);
//
// Required for Windows Form Designer support
//
InitializeComponent();
// Put the book name in the dialog caption
Text = string.Format(Text, book.Name.UserDefaultWritingSystem);
m_listBookInfo.Cache = book.Cache;
m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
(int)ScrBook.ScrBookTags.kflidName, TeResourceHelper.GetResourceString("kstidBookNameColHeader"),
60));
m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
(int)ScrBook.ScrBookTags.kflidAbbrev, TeResourceHelper.GetResourceString("kstidBookAbbrevColHeader"),
40));
m_listBookInfo.RootObject = book.Hvo;
foreach (int ws in book.Cache.LangProject.CurrentAnalysisAndVernWss)
m_listBookInfo.WritingSystemsToDisplay.Add(ws);
// Initialize the ID textbox.
m_txtScrBookIdText.Text = m_currentBook.IdText;
}
示例5: Initialize
/// <summary>
/// Create and initialize the browse view, storing the data it will display.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="stylesheet">The stylesheet.</param>
/// <param name="mediator">The mediator.</param>
/// <param name="xnConfig">The config node.</param>
/// <param name="objs">The objs.</param>
public void Initialize(FdoCache cache, IVwStylesheet stylesheet, Mediator mediator,
XmlNode xnConfig, IEnumerable<ICmObject> objs)
{
CheckDisposed();
m_cache = cache;
m_stylesheet = stylesheet;
m_mediator = mediator;
m_configNode = xnConfig;
SuspendLayout();
m_listPublisher = new ObjectListPublisher(cache.DomainDataByFlid as ISilDataAccessManaged, ObjectListFlid);
StoreData(objs);
m_bvList = new BrowseViewer(m_configNode, m_cache.LanguageProject.Hvo, ObjectListFlid, m_cache, m_mediator,
null, m_listPublisher);
m_bvList.Location = new Point(0, 0);
m_bvList.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom |
AnchorStyles.Right;
m_bvList.Name = "m_bvList";
m_bvList.Sorter = null;
m_bvList.TabStop = true;
m_bvList.StyleSheet = m_stylesheet;
m_bvList.Dock = DockStyle.Fill;
m_bvList.SelectionChanged += m_bvList_SelectionChanged;
Controls.Add(m_bvList);
ResumeLayout(false);
}
示例6: BookPropertiesDialog
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="BookPropertiesDialog"/> class.
/// </summary>
/// <param name="book">the current book</param>
/// <param name="stylesheet">The stylesheet.</param>
/// <param name="helpTopicProvider">The help topic provider.</param>
/// ------------------------------------------------------------------------------------
public BookPropertiesDialog(IScrBook book, IVwStylesheet stylesheet, IHelpTopicProvider helpTopicProvider)
{
m_currentBook = book;
m_helpTopicProvider = helpTopicProvider;
// TE-5663: make sure the book's name and abbreviation are updated if some were added
IScrRefSystem scrRefSystem = book.Cache.ServiceLocator.GetInstance<IScrRefSystemRepository>().AllInstances().FirstOrDefault();
book.Name.MergeAlternatives(scrRefSystem.BooksOS[book.CanonicalNum - 1].BookName);
book.Abbrev.MergeAlternatives(scrRefSystem.BooksOS[book.CanonicalNum - 1].BookAbbrev);
//
// Required for Windows Form Designer support
//
InitializeComponent();
// Put the book name in the dialog caption
Text = string.Format(Text, book.Name.UserDefaultWritingSystem.Text);
m_listBookInfo.Cache = book.Cache;
m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
ScrBookTags.kflidName, TeResourceHelper.GetResourceString("kstidBookNameColHeader"), 60));
m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
ScrBookTags.kflidAbbrev, TeResourceHelper.GetResourceString("kstidBookAbbrevColHeader"), 40));
m_listBookInfo.RootObject = book.Hvo;
foreach (IWritingSystem ws in book.Cache.ServiceLocator.WritingSystems.AllWritingSystems)
m_listBookInfo.WritingSystemsToDisplay.Add(ws.Handle);
// Initialize the ID textbox.
m_txtScrBookIdText.Text = m_currentBook.IdText;
}
示例7: ShowNewDialog
/// <summary>
/// Shows the new writing system properties dialog.
/// </summary>
/// <param name="owner">The owner.</param>
/// <param name="cache">The cache.</param>
/// <param name="wsManager">The ws manager.</param>
/// <param name="wsContainer">The ws container.</param>
/// <param name="helpTopicProvider">The help topic provider.</param>
/// <param name="app">The app.</param>
/// <param name="stylesheet">The stylesheet.</param>
/// <param name="displayRelatedWss">if set to <c>true</c> related writing systems will be displayed.</param>
/// <param name="defaultName">The default language name for the new writing system.</param>
/// <param name="newWritingSystems">The new writing systems.</param>
/// <returns></returns>
public static bool ShowNewDialog(Form owner, FdoCache cache, IWritingSystemManager wsManager,
IWritingSystemContainer wsContainer, IHelpTopicProvider helpTopicProvider, IApp app,
IVwStylesheet stylesheet, bool displayRelatedWss, string defaultName,
out IEnumerable<IWritingSystem> newWritingSystems)
{
newWritingSystems = null;
LanguageSubtag languageSubtag;
using (new WaitCursor(owner))
using (var dlg = new LanguageSelectionDlg(wsManager, helpTopicProvider))
{
dlg.Text = FwCoreDlgs.kstidLanguageSelectionNewWsCaption;
dlg.DefaultLanguageName = defaultName;
if (dlg.ShowDialog(owner) != DialogResult.OK)
return false;
languageSubtag = dlg.LanguageSubtag;
}
using (new WaitCursor(owner))
using (var wsPropsDlg = new WritingSystemPropertiesDialog(cache, wsManager, wsContainer, helpTopicProvider, app, stylesheet))
{
wsPropsDlg.SetupDialog(languageSubtag, displayRelatedWss);
if (wsPropsDlg.ShowDialog(owner) == DialogResult.OK)
{
newWritingSystems = wsPropsDlg.NewWritingSystems;
return true;
}
}
return false;
}
示例8: EmptyTePrintLayoutConfigurer
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructs a EmptyTePrintLayoutConfigurer to configure the main print layout
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="styleSheet">The style sheet.</param>
/// <param name="viewType">Type of the view.</param>
/// ------------------------------------------------------------------------------------
public EmptyTePrintLayoutConfigurer(FdoCache cache, IVwStylesheet styleSheet,
TeViewType viewType)
{
m_fdoCache = cache;
m_styleSheet = styleSheet;
m_viewType = viewType;
}
示例9: SimpleDraftViewWrapper
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="SimpleDraftViewWrapper"/> class.
/// </summary>
/// <param name="name">The name of the split grid</param>
/// <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.</param>
/// <param name="styleSheet">The style sheet.</param>
/// <param name="settingsRegKey">The settings reg key.</param>
/// <param name="draftViewInfo">Information about the draft view.</param>
/// <param name="draftStylebarInfo">Information about the draft stylebar.</param>
/// <param name="footnoteViewInfo">Information about the footnote draft view.</param>
/// <param name="footnoteStylebarInfo">Information about the footnote stylebar.</param>
/// ------------------------------------------------------------------------------------
public SimpleDraftViewWrapper(string name, Control parent, FdoCache cache,
IVwStylesheet styleSheet, RegistryKey settingsRegKey, object draftViewInfo,
object draftStylebarInfo, object footnoteViewInfo, object footnoteStylebarInfo)
: base(name, parent, cache, styleSheet, settingsRegKey, draftViewInfo, draftStylebarInfo,
footnoteViewInfo, footnoteStylebarInfo, 2, 2)
{
}
示例10: SimpleDraftViewWrapper
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="SimpleDraftViewWrapper"/> class.
/// </summary>
/// <param name="name">The name of the split grid</param>
/// <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.</param>
/// <param name="styleSheet">The style sheet.</param>
/// <param name="settingsRegKey">The settings reg key.</param>
/// <param name="draftViewInfo">The Scripture draft view proxy.</param>
/// <param name="draftStylebarInfo">The Scripture draft stylebar proxy.</param>
/// <param name="footnoteViewInfo">The footnote draft view proxy.</param>
/// <param name="footnoteStylebarInfo">The footnote stylebar proxy.</param>
/// ------------------------------------------------------------------------------------
internal SimpleDraftViewWrapper(string name, Control parent, FdoCache cache,
IVwStylesheet styleSheet, RegistryKey settingsRegKey, TeScrDraftViewProxy draftViewInfo,
DraftStylebarProxy draftStylebarInfo, TeFootnoteDraftViewProxy footnoteViewInfo,
DraftStylebarProxy footnoteStylebarInfo)
: base(name, parent, cache, styleSheet, settingsRegKey, draftViewInfo, draftStylebarInfo,
footnoteViewInfo, footnoteStylebarInfo, 2, 2)
{
}
示例11: MaxStringWidthForChartColumn
public MaxStringWidthForChartColumn(ConstChartVc vc, IVwStylesheet stylesheet, ISilDataAccess sda, int hvoRoot,
System.Drawing.Graphics graphics, int icolumn)
: base(stylesheet, sda, hvoRoot, graphics, icolumn)
{
m_vc = vc;
m_cLines = m_vc.LineChoices.Count;
m_paraWidths = new int[m_cLines];
}
示例12: TryAWordSandbox
/// <summary>
/// Create a new one.
/// </summary>
/// <param name="cache"></param>
/// <param name="ss"></param>
/// <param name="choices"></param>
/// <param name="hvoWordform"></param>
/// <param name="mediator"></param>
public TryAWordSandbox(FdoCache cache, Mediator mediator, IVwStylesheet ss, InterlinLineChoices choices,
int hvoWordform)
: base(cache, mediator, ss, choices)
{
SizeToContent = true;
//RawWordform = word;
base.LoadForWordBundleAnalysis(hvoWordform);
}
示例13: TeBtPrintLayoutConfig
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructs a TePrintLayoutConfig to configure the main print layout
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="styleSheet">The style sheet.</param>
/// <param name="publication">The publication.</param>
/// <param name="viewType">Type of the view.</param>
/// <param name="filterInstance">the book filter instance in effect</param>
/// <param name="printDateTime">printing date and time</param>
/// <param name="fIntroDivision">set to <c>true</c> for a division that displays book
/// title and introduction material, <c>false</c> for a division that displays main
/// scripture text.</param>
/// <param name="hvoBook">The hvo of the book.</param>
/// <param name="sharedStream">A layout stream used for footnotes which is shared across
/// multiple divisions</param>
/// <param name="ws">The writing system to use for the back translation</param>
/// ------------------------------------------------------------------------------------
public TeBtPrintLayoutConfig(FdoCache cache, IVwStylesheet styleSheet,
IPublication publication, TeViewType viewType, int filterInstance,
DateTime printDateTime, bool fIntroDivision, int hvoBook, IVwLayoutStream sharedStream,
int ws)
: base(cache, styleSheet, publication, viewType, filterInstance, printDateTime,
fIntroDivision, hvoBook, sharedStream, ws)
{
}
示例14: CheckingErrorCommentDlg
/// ------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
/// ------------------------------------------------------------------------------------
public CheckingErrorCommentDlg(CheckingError error, IVwStylesheet stylesheet) : this()
{
System.Diagnostics.Debug.Assert(error != null);
m_text = new FwMultiParaTextBox(error.ResolutionOA, stylesheet);
m_text.Dock = DockStyle.Fill;
pnlTextBox.Controls.Add(m_text);
m_error = error;
}
示例15: GetAdjustedTsString
/// -------------------------------------------------------------------------------------
/// <summary>
/// Make sure that all runs of the given ts string will fit within the given height.
/// </summary>
/// <param name="tss">(Potentially) unadjusted TsString -- may have some pre-existing
/// adjustments, but if it does, we (probably) ignore those and recheck every run</param>
/// <param name="dympMaxHeight">The maximum height (in millipoints) of the Ts String.</param>
/// <param name="styleSheet"></param>
/// <param name="writingSystemFactory"></param>
/// -------------------------------------------------------------------------------------
public static ITsString GetAdjustedTsString(ITsString tss, int dympMaxHeight,
IVwStylesheet styleSheet, ILgWritingSystemFactory writingSystemFactory)
{
if (dympMaxHeight == 0)
return tss;
ITsStrBldr bldr = null;
int runCount = tss.RunCount;
for (int irun = 0; irun < runCount; irun++)
{
ITsTextProps props = tss.get_Properties(irun);
int var;
int wsTmp = props.GetIntPropValues((int)FwTextPropType.ktptWs,
out var);
string styleName =
props.GetStrPropValue((int)FwTextStringProp.kstpNamedStyle);
int height;
string name;
float sizeInPoints;
using (Font f = GetFontForStyle(styleName, styleSheet, wsTmp, writingSystemFactory))
{
height = GetFontHeight(f);
name = f.Name;
sizeInPoints = f.SizeInPoints;
}
int curHeight = height;
// incrementally reduce the size of the font until the text can fit
while (curHeight > dympMaxHeight)
{
using (var f = new Font(name, sizeInPoints - 0.25f))
{
curHeight = GetFontHeight(f);
name = f.Name;
sizeInPoints = f.SizeInPoints;
}
}
if (curHeight != height)
{
// apply formatting to the problem run
if (bldr == null)
bldr = tss.GetBldr();
int iStart = tss.get_MinOfRun(irun);
int iEnd = tss.get_LimOfRun(irun);
bldr.SetIntPropValues(iStart, iEnd,
(int)FwTextPropType.ktptFontSize,
(int)FwTextPropVar.ktpvMilliPoint, (int)(sizeInPoints * 1000.0f));
}
}
if (bldr != null)
return bldr.GetString();
else
return tss;
}