This class captures all of the configurable settings for FDO.
示例#1
0
		private static FdoSettings CreateFdoSettings()
		{
			var settings = new FdoSettings();

			int sharedXmlBackendCommitLogSize = 0;
			if (FwRegistryHelper.FieldWorksRegistryKey != null)
				sharedXmlBackendCommitLogSize = (int) FwRegistryHelper.FieldWorksRegistryKey.GetValue("SharedXMLBackendCommitLogSize", 0);
			if (sharedXmlBackendCommitLogSize == 0 && FwRegistryHelper.FieldWorksRegistryKeyLocalMachine != null)
				sharedXmlBackendCommitLogSize = (int) FwRegistryHelper.FieldWorksRegistryKeyLocalMachine.GetValue("SharedXMLBackendCommitLogSize", 0);
			if (sharedXmlBackendCommitLogSize > 0)
				settings.SharedXMLBackendCommitLogSize = sharedXmlBackendCommitLogSize;
			return settings;
		}
示例#2
0
        private FdoCache TryGetFdoCache()
        {
            FdoCache fdoCache = null;
            var path = _project.Path;
            if (!File.Exists(path))
            {
                return null;
            }

            var settings = new FdoSettings {DisableDataMigration = true};

            try
            {
                fdoCache = FdoCache.CreateCacheFromExistingData(
                    _project, Thread.CurrentThread.CurrentUICulture.Name, _fdoUi,
                    _project.FdoDirectories, settings, _progress);
            }
            catch (FdoDataMigrationForbiddenException)
            {
                MainClass.Logger.Error("FDO: Incompatible version (can't migrate data)");
                return null;
            }
            catch (FdoNewerVersionException)
            {
                MainClass.Logger.Error("FDO: Incompatible version (version number newer than expected)");
                return null;
            }
            catch (FdoFileLockedException)
            {
                MainClass.Logger.Error("FDO: Access denied");
                return null;
            }
            catch (StartupException)
            {
                MainClass.Logger.Error("FDO: Unknown error");
                return null;
            }

            return fdoCache;
        }