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


C# FdoCache.GetNumberOfRemoteClients方法代码示例

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


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

示例1: NewMainAppWnd

		protected override Form NewMainAppWnd(FdoCache cache, bool isNewCache, Form wndCopyFrom,
			bool fOpeningNewProject)
		{
			WriteSplashScreen(String.Format(LexTextStrings.ksCreatingWindowForX, cache.DatabaseName));

			// The try-catch block is modeled after that used by TeScrInitializer.Initialize(),
			// as the suggestion for fixing LT-8797.
			try
			{
				// Make sure this DB uses the current stylesheet version.
				if (MiscUtils.IsServerLocal(cache.ServerName) && cache.GetNumberOfRemoteClients() == 0)
					FlexStylesXmlAccessor.EnsureCurrentStylesheet(cache.LangProject);
			}
			catch (WorkerThreadException e)
			{
				UndoResult ures;
				while (cache.Undo(out ures)) ; // Enhance JohnT: make use of ures?
				MessageBox.Show(Form.ActiveForm, e.InnerException.Message,
					LexTextStrings.ksFieldWorksLanguageExplorer,
					MessageBoxButtons.OK, MessageBoxIcon.Error);
				return null;
			}
			Form form = base.NewMainAppWnd(cache, isNewCache, wndCopyFrom, fOpeningNewProject);

			// Ensure that all the relevant writing systems are installed.
			if (isNewCache)
			{
				ILangProject lp = cache.LangProject;
				// Loop through the Vernacular WS and initialize them
				foreach (ILgWritingSystem ws in lp.VernWssRC)
					cache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(ws.Hvo);
				// Loop through the Analysis WS and initialize them
				foreach (ILgWritingSystem ws in lp.AnalysisWssRC)
					cache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(ws.Hvo);
			}
			cache.Save();

			if (form != null && form is FwXWindow)
			{
				FwXWindow wnd = form as FwXWindow;
				wnd.Mediator.BroadcastPendingItems();
				IFwCheckAnthroList fcal = FwCheckAnthroListClass.Create();
				string sDesc = wnd.Mediator.StringTbl.GetString("AnthroListUse", "DialogStrings");
				fcal.Description = sDesc;
				string sHelpFile = HelpFile;
				fcal.HelpFilename = sHelpFile;
				fcal.CheckAnthroList(wnd.Cache.DatabaseAccessor, (uint)form.Handle,
					wnd.Cache.LangProject.Name.UserDefaultWritingSystem, wnd.Cache.DefaultUserWs);
				m_activeMainWindow = form;
			}
			if (isNewCache && form != null)
				InitializePartInventories(cache, true);
			return form;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:54,代码来源:LexTextApp.cs

示例2: EnsureProjectComponentsValid

		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Ensures all of the project components are valid.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="existingProgressDlg">The existing progress dialog.</param>
		/// ------------------------------------------------------------------------------------
		public static void EnsureProjectComponentsValid(FdoCache cache, IAdvInd4 existingProgressDlg)
		{
			EnsureProjectValid(cache, existingProgressDlg);

			// TE-8621: Don't try to upgrade the database unless we're the project server and no one is connected
			if (!MiscUtils.IsServerLocal(cache.ServerName) || cache.GetNumberOfRemoteClients() > 0)
				return;

			ILangProject lp = cache.LangProject;

			TePublicationsInit.EnsureFactoryPublications(lp, existingProgressDlg);
			TeStylesXmlAccessor.EnsureCurrentStylesheet(lp, existingProgressDlg);
			TeScrNoteCategoriesInit.EnsureCurrentScrNoteCategories(lp, existingProgressDlg);
			TeKeyTermsInit.EnsureCurrentKeyTerms(lp, existingProgressDlg);
			cache.Save();
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:23,代码来源:TeScrInitializer.cs


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