本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache类的典型用法代码示例。如果您正苦于以下问题:C# FdoCache类的具体用法?C# FdoCache怎么用?C# FdoCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FdoCache类属于SIL.FieldWorks.FDO命名空间,在下文中一共展示了FdoCache类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: UndoRemoveBookAction
/// ------------------------------------------------------------------------------------
/// <summary>
///
/// </summary>
/// <param name="cache"></param>
/// <param name="filter">book filter in place</param>
/// <param name="bookID">ordinal ID of the book being removed</param>
/// ------------------------------------------------------------------------------------
public UndoRemoveBookAction(FdoCache cache, FilteredScrBooks filter, int bookID)
{
m_cache = cache;
m_bookFilter = filter;
m_bookID = bookID;
m_bookHvo = ScrBook.FindBookByID(m_cache, bookID).Hvo;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:15,代码来源:TeUndoActions.cs
示例2: SetDlgInfoForComponentLexeme
/// <summary>
/// when calling the dialog from an "Insert Variant" context this
/// constructor is used to indicate that m_startingEntry is a componentLexeme
/// rather than the variant
/// </summary>
/// <param name="cache"></param>
/// <param name="mediator"></param>
/// <param name="componentLexeme">the entry we wish to find or create a variant for.</param>
protected void SetDlgInfoForComponentLexeme(FdoCache cache, Mediator mediator, IVariantComponentLexeme componentLexeme)
{
m_fBackRefToVariant = true;
ILexEntry startingEntry = null;
if (componentLexeme.ClassID == LexEntry.kclsidLexEntry)
{
startingEntry = componentLexeme as LexEntry;
}
else
{
int hvoEntry = cache.GetOwnerOfObjectOfClass(componentLexeme.Hvo, LexEntry.kclsidLexEntry);
if (hvoEntry != 0)
startingEntry = LexEntry.CreateFromDBObject(cache, hvoEntry);
}
base.SetDlgInfo(cache, mediator, startingEntry);
// we are looking for an existing variant form
// so hide the Entry/Sense radio group box.
grplbl.Visible = false;
// also hide variant type.
tcVariantTypes.Visible = false;
lblVariantType.Visible = false;
m_fGetVariantEntryTypeFromTreeCombo = false;
lblCreateEntry.Visible = false;
// The dialog title and other labels need to reflect "Insert Variant" context.
m_formLabel.Text = LexTextControls.ks_Variant;
this.Text = LexTextControls.ksFindVariant;
btnInsert.Text = LexTextControls.ks_Create;
// We disable the "Create" button when we don't have text in the Find textbox.
UpdateButtonCreateNew();
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:39,代码来源:LinkVariantToEntryOrSense.cs
示例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();
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:39,代码来源:ImportDialog.cs
示例4: ImportFileSource
/// ------------------------------------------------------------------------------------
/// <summary>
/// Constructor based on a hashtable which maps HVOs of ScrImportSource objects to
/// ScrSfFileList objects
/// </summary>
/// <param name="sourceTable">The hashtable</param>
/// <param name="cache">The FDO cache needed for interpreting the HVOs</param>
/// ------------------------------------------------------------------------------------
public ImportFileSource(Hashtable sourceTable, FdoCache cache)
{
Debug.Assert(sourceTable != null);
m_cache = cache;
m_sourceTable = sourceTable;
m_fileList = null;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:15,代码来源:ImportFileSource.cs
示例5: 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
示例6: MorphBreakHelperMenu
/// <summary>
/// Constructor for Morph Break Helper Context Menu
/// </summary>
/// <param name="textbox">the textbox to insert regex characters into</param>
/// <param name="helpTopicProvider">usually IHelpTopicProvider.App</param>
/// <param name="cache">cache</param>
/// <param name="stringTable">stringTable</param>
public MorphBreakHelperMenu(FwTextBox textbox, IHelpTopicProvider helpTopicProvider, FdoCache cache, StringTable stringTable)
: base(textbox, helpTopicProvider)
{
m_cache = cache;
m_stringTable = stringTable;
Init();
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:14,代码来源:MorphBreakHelperMenu.cs
示例7: InfoPane
public InfoPane(FdoCache cache, Mediator mediator, RecordClerk clerk)
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
Initialize(cache, mediator, clerk);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:7,代码来源:InfoPane.cs
示例8: FilterTextsDialogTE
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the ChooseScriptureDialog class.
/// WARNING: this constructor is called by reflection, at least in the Interlinear
/// Text DLL. If you change its parameters be SURE to find and fix those callers also.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="objList">A list of texts and books to check as an array of hvos</param>
/// <param name="helpTopicProvider">The help topic provider.</param>
/// <param name="importer">The Paratext book importer.</param>
/// ------------------------------------------------------------------------------------
public FilterTextsDialogTE(FdoCache cache, IStText[] objList,
IHelpTopicProvider helpTopicProvider, IBookImporter importer)
: base(cache, objList, helpTopicProvider)
{
m_bookImporter = importer;
using (var progressDlg = new ProgressDialogWithTask(this))
{
// This somewhat duplicates some logic in FieldWorks.GetHelpTopicProvider, but it feels
// wrong to reference the main exe even though I can't find an actual circular dependency.
// As far as I can discover, the help topic provider is only used if the user has modified
// TE styles and TE needs to display a dialog about it (possibly because it has loaded a
// new version of the standard ones?). Anyway, I don't think it will be used at all if TE
// is not installed, so it should be safe to use the regular FLEx one.
IHelpTopicProvider helpProvider;
if (FwUtils.FwUtils.IsTEInstalled)
{
helpProvider = (IHelpTopicProvider) DynamicLoader.CreateObject(FwDirectoryFinder.TeDll,
"SIL.FieldWorks.TE.TeHelpTopicProvider");
}
else
{
helpProvider = (IHelpTopicProvider)DynamicLoader.CreateObject(FwDirectoryFinder.FlexDll,
"SIL.FieldWorks.XWorks.LexText.FlexHelpTopicProvider");
}
NonUndoableUnitOfWorkHelper.Do(cache.ActionHandlerAccessor, () =>
TeScrInitializer.EnsureMinimalScriptureInitialization(cache, progressDlg,
helpProvider));
}
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:40,代码来源:FilterTextsDialogTE.cs
示例9: AddToDatabase
public override void AddToDatabase(FdoCache cache)
{
if (m_fInDatabase)
return; // It's already in the database, so nothing more can be done.
using (var undoHelper = new UndoableUnitOfWorkHelper(
cache.ServiceLocator.GetInstance<IActionHandler>(),
MGAStrings.ksUndoCreateInflectionFeature,
MGAStrings.ksRedoCreateInflectionFeature))
{
m_featDefn = cache.LanguageProject.MsFeatureSystemOA.AddFeatureFromXml(m_node);
// Attempt to add feature to category as an inflectable feature
var sPosId = XmlUtils.GetOptionalAttributeValue(m_node, "posid");
var node = m_node;
while (node.ParentNode != null && sPosId == null)
{
node = node.ParentNode;
sPosId = XmlUtils.GetOptionalAttributeValue(node, "posid");
}
foreach (IPartOfSpeech pos in cache.LanguageProject.PartsOfSpeechOA.ReallyReallyAllPossibilities)
{
if (pos.CatalogSourceId == sPosId)
{
pos.InflectableFeatsRC.Add(m_featDefn);
break;
}
}
undoHelper.RollBack = false;
}
}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:31,代码来源:MasterInflectionFeature.cs
示例10: InterlinearExporter
protected InterlinearExporter(FdoCache cache, XmlWriter writer, ICmObject objRoot,
InterlinLineChoices lineChoices, InterlinVc vc)
: base(null, cache.MainCacheAccessor, objRoot.Hvo)
{
m_cache = cache;
m_writer = writer;
m_flidStTextTitle = m_cache.MetaDataCacheAccessor.GetFieldId("StText", "Title", false);
m_flidStTextSource = m_cache.MetaDataCacheAccessor.GetFieldId("StText", "Source", false);
m_vc = vc;
SetTextTitleAndMetadata(objRoot as IStText);
// Get morphtype information that we need later. (plus stuff we don't...) See LT-8288.
IMoMorphType mmtStem;
IMoMorphType mmtPrefix;
IMoMorphType mmtSuffix;
IMoMorphType mmtInfix;
IMoMorphType mmtBoundStem;
IMoMorphType mmtSimulfix;
IMoMorphType mmtSuprafix;
m_cache.ServiceLocator.GetInstance<IMoMorphTypeRepository>().GetMajorMorphTypes(
out mmtStem, out mmtPrefix, out mmtSuffix, out mmtInfix,
out mmtBoundStem, out m_mmtProclitic, out m_mmtEnclitic,
out mmtSimulfix, out mmtSuprafix);
m_wsManager = m_cache.ServiceLocator.WritingSystemManager;
m_repoObj = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>();
}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:27,代码来源:InterlinearExporter.cs
示例11: LayoutFinder
/// ------------------------------------------------------------------------------------
/// <summary>
/// normal constructor.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="layoutName">Name of the layout.</param>
/// <param name="colSpec">The col spec.</param>
/// <param name="stringTbl">The string TBL.</param>
/// ------------------------------------------------------------------------------------
public LayoutFinder(FdoCache cache, string layoutName, XmlNode colSpec, StringTable stringTbl)
{
m_layoutName = layoutName;
m_colSpec = colSpec;
m_stringTbl = stringTbl;
Cache = cache;
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:16,代码来源:LayoutFinder.cs
示例12: FixtureSetup
public override void FixtureSetup()
{
string partDirectory = Path.Combine(SIL.FieldWorks.Common.Utils.DirectoryFinder.FwSourceDirectory,
@"common\controls\detailcontrols\detailcontrolstests");
Dictionary<string, string[]> keyAttrs = new Dictionary<string, string[]>();
keyAttrs["layout"] = new string[] {"class", "type", "name" };
keyAttrs["group"] = new string[] {"label"};
keyAttrs["part"] = new string[] {"ref"};
string configurationDir = Path.Combine(SIL.FieldWorks.Common.Utils.DirectoryFinder.FWCodeDirectory,
@"Language Explorer\Configuration");
m_stringTable = new SIL.Utils.StringTable(configurationDir);
m_layouts = new Inventory(new string[] {partDirectory},
"*Layouts.xml", "/LayoutInventory/*", keyAttrs);
keyAttrs = new Dictionary<string, string[]>();
keyAttrs["part"] = new string[] {"id"};
m_parts = new Inventory(new string[] {partDirectory},
"*Parts.xml", "/PartInventory/bin/*", keyAttrs);
m_cache = FdoCache.Create("TestLangProj");
m_entry = new LexEntry();
m_cache.LangProject.LexDbOA.EntriesOC.Add(m_entry);
m_entry.CitationForm.VernacularDefaultWritingSystem = "rubbish";
// We set both alternatives because currently the default part for Bibliography uses vernacular,
// but I think this will probably get fixed. Anyway, this way the test is robust.
m_entry.Bibliography.SetAnalysisDefaultWritingSystem("My rubbishy bibliography");
m_entry.Bibliography.SetVernacularDefaultWritingSystem("My rubbishy bibliography");
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:32,代码来源:DataTreeTests.cs
示例13: InterAreaBookmark
internal InterAreaBookmark(InterlinMaster interlinMaster, Mediator mediator, FdoCache cache) // For restoring
{
// Note: resist any temptation to save mediator in a memer variable. Bookmarks are kept in a static dictionary
// and may well have a longer life than the mediator. There is danger of using if after it is disposed. See LT-12435.
Init(interlinMaster, cache);
Restore(interlinMaster.IndexOfTextRecord, mediator);
}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:7,代码来源:InterAreaBookmark.cs
示例14: Initialize
public void Initialize(ICmObject rootObj, int rootFlid, string rootFieldName, FdoCache cache, string displayNameProperty,
Mediator mediator, string displayWs)
{
CheckDisposed();
m_displayWs = displayWs;
Initialize(rootObj, rootFlid, rootFieldName, cache, displayNameProperty, mediator);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:7,代码来源:VectorReferenceView.cs
示例15:
/// <summary>
/// From IFwExtension
/// </summary>
/// <param name="cache"></param>
/// <param name="mediator"></param>
void IFwExtension.Init(FdoCache cache, Mediator mediator)
{
m_cache = cache;
m_mediator = mediator;
string sPrevFile = m_mediator.PropertyTable.GetStringProperty(FilePropertyName, null);
if (!String.IsNullOrEmpty(sPrevFile))
{
tbPath.Text = sPrevFile;
UpdateButtons();
}
string sMergeStyle = m_mediator.PropertyTable.GetStringProperty(MergeStylePropertyName, null);
if (!String.IsNullOrEmpty(sMergeStyle))
{
m_msImport = (FlexLiftMerger.MergeStyle)Enum.Parse(typeof(FlexLiftMerger.MergeStyle), sMergeStyle, true);
switch (m_msImport)
{
case FlexLiftMerger.MergeStyle.MsKeepOld:
m_rbKeepCurrent.Checked = true;
break;
case FlexLiftMerger.MergeStyle.MsKeepNew:
m_rbKeepNew.Checked = true;
break;
case FlexLiftMerger.MergeStyle.MsKeepBoth:
m_rbKeepBoth.Checked = true;
break;
default:
m_rbKeepCurrent.Checked = true;
break;
}
}
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:36,代码来源:LiftImportDlg.cs
示例16: MGAHtmlHelpDialog
public MGAHtmlHelpDialog(FdoCache cache, Mediator mediator, string sMorphemeForm) : base(cache, mediator, sMorphemeForm)
{
#if __MonoCS__
m_browser = new GeckoWebBrowser
{
Dock = DockStyle.Fill,
Location = new Point(0, 0),
TabIndex = 1,
MinimumSize = new Size(20, 20),
NoDefaultContextMenu = true
};
splitContainerHorizontal.Panel2.Controls.Add(m_browser);
#else
m_webBrowserInfo = new WebBrowser
{
Dock = DockStyle.Fill,
Location = new Point(0, 0),
TabIndex = 1,
IsWebBrowserContextMenuEnabled = false,
MinimumSize = new Size(20, 20),
Name = "webBrowserInfo",
WebBrowserShortcutsEnabled = false
};
splitContainerHorizontal.Panel2.Controls.Add(m_webBrowserInfo);
#endif
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:27,代码来源:MGAHtmlHelpDialog.cs
示例17: FootnoteView
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the FootnoteView class
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="filterInstance">The tag that identifies the book filter instance.</param>
/// <param name="app">The application.</param>
/// <param name="viewName">The name of the view.</param>
/// <param name="fEditable"><c>true</c> if view is to be editable.</param>
/// <param name="viewType">Bit-flags indicating type of view.</param>
/// <param name="btWs">The back translation writing system (if needed).</param>
/// <param name="draftView">The corresponding draftview pane</param>
/// ------------------------------------------------------------------------------------
public FootnoteView(FdoCache cache, int filterInstance, IApp app, string viewName,
bool fEditable, TeViewType viewType, int btWs, DraftView draftView) :
base(cache, filterInstance, app, viewName, fEditable, viewType, btWs)
{
Debug.Assert((viewType & TeViewType.FootnoteView) != 0);
m_draftView = draftView;
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:20,代码来源:FootnoteView.cs
示例18: 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);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:15,代码来源:TryAWordSandbox.cs
示例19: MultipleFilterDlg
/// ------------------------------------------------------------------------------------
/// <summary>
/// Initializes a new instance of the <see cref="T:MultipleFilterDlg"/> class.
/// </summary>
/// ------------------------------------------------------------------------------------
public MultipleFilterDlg(FdoCache cache, ICmFilter filter) : this()
{
m_cache = cache;
m_scr = (Scripture)cache.LangProject.TranslatedScriptureOA;
m_filter = filter;
// Initialize the enabled status of the group boxes.
chkStatus_CheckedChanged(null, null);
chkType_CheckedChanged(null, null);
chkScrRange_CheckedChanged(null, null);
// Initialize the beginning and ending default Scripture references.
int firstBook = 1;
int lastBook = ScrReference.LastBook;
if (m_scr.ScriptureBooksOS.Count > 0)
{
firstBook = m_scr.ScriptureBooksOS[0].CanonicalNum;
lastBook = m_scr.ScriptureBooksOS[m_scr.ScriptureBooksOS.Count - 1].CanonicalNum;
}
scrBookFrom.Initialize(new ScrReference(firstBook,
1, 1, m_scr.Versification), m_scr, false);
scrBookTo.Initialize(new ScrReference(lastBook,
1, 0, m_scr.Versification).LastReferenceForBook, m_scr, false);
// Update the controls from the filter in the database.
InitializeFromFilter();
chkCategory.Checked = tvCatagories.Load(m_cache, m_filter, null);
chkCategory_CheckedChanged(null, null);
}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:36,代码来源:MultipleFilterDlg.cs
示例20: 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);
}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:34,代码来源:FlatListView.cs
注:本文中的SIL.FieldWorks.FDO.FdoCache类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论