本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.Save方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.Save方法的具体用法?C# FdoCache.Save怎么用?C# FdoCache.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.Save方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
示例2: 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;
}
示例3: RemoveFdoCache
/// ------------------------------------------------------------------------------------
/// <summary>
/// Removes the specified FdoCache cleanly, saving it first.
/// </summary>
/// ------------------------------------------------------------------------------------
public void RemoveFdoCache(FdoCache wndCache)
{
CheckDisposed();
// To be safe - this method might get called recursively (explicitly and from
// Application.Exit() below again).
if (wndCache.IsDisposed)
return;
Debug.Assert(wndCache != null);
wndCache.Save();
DataUpdateMonitor.RemoveDataAccess(wndCache.MainCacheAccessor);
m_caches.Remove(MakeKey(wndCache.ServerName, wndCache.DatabaseName));
wndCache.Dispose();
// If the last cache was removed, then exit the application
if ((!m_fSuppressClose) && m_fOkToClose && m_caches.Count == 0)
{
EditingHelper.ClearTsStringClipboard();
Application.Exit();
}
}