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


C# FDO.FdoCache类代码示例

本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache的典型用法代码示例。如果您正苦于以下问题:C# FdoCache类的具体用法?C# FdoCache怎么用?C# FdoCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FdoCache类属于SIL.FieldWorks.FDO命名空间,在下文中一共展示了FdoCache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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