Ejemplo n.º 1
0
        public void SetUp()
        {
            RegistryHelper.CompanyName = "SIL";
            RegistryHelper.ProductName = "FieldWorks";

            FwRegistrySettings.Init();
            m_RegistryKey = RegistryHelper.SettingsKey(FwSubKey.TE, "Dummy");
            TeProjectSettings.InitSettings(m_RegistryKey);
        }
Ejemplo n.º 2
0
 public void TearDown()
 {
     TeProjectSettings.Release();
     FwRegistrySettings.Release();
     ReflectionHelper.CallStaticMethod("FwResources.dll",
                                       "SIL.FieldWorks.Resources.ResourceHelper", "ShutdownHelper");
     if (m_RegistryKey != null)
     {
         m_RegistryKey.Dispose();
     }
     m_RegistryKey = null;
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Overridden to load the libronix setting and implement it.
        /// </summary>
        public override void LoadSettings()
        {
            base.LoadSettings();
#if !__MonoCS__
            if (Options.AutoStartLibronix)
            {
                LibronixWorkspaceManager.RestoreIfNotRunning(WorkspaceLocation());
            }
#else
            if (Options.AutoStartLibronix)
            {
                throw new NotImplementedException();
            }
            // TODO-Linux: Librionix not ported..
#endif
            TeProjectSettings.InitSettings(this);
        }
Ejemplo n.º 4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="TeEditingHelper"/> class.
		/// </summary>
		/// <param name="callbacks">The callbacks.</param>
		/// <param name="cache">The cache.</param>
		/// <param name="filterInstance">The filter instance.</param>
		/// <param name="viewType">Type of the view.</param>
		/// ------------------------------------------------------------------------------------
		public TeEditingHelper(IEditingCallbacks callbacks, FdoCache cache, int filterInstance,
			TeViewType viewType) : base(cache, callbacks)
		{
			CanDoRtL = true;
			if (m_cache != null)
				m_scr = m_cache.LangProject.TranslatedScriptureOA;

			m_viewType = viewType;
			m_filterInstance = filterInstance;
			m_projectSettings = TeProjectSettings.LoadSettings(cache);
			m_annotationAdjuster = new AnnotationAdjuster(cache, this);
			PasteFixTssEvent += RemoveHardFormatting;
			m_syncHandler = new FocusMessageHandling(this);
		}
Ejemplo n.º 5
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Loads the project settings.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public static TeProjectSettings LoadSettings(FdoCache cache)
		{
			if (s_settings.ContainsKey(cache))
				return s_settings[cache];

			TeProjectSettings projectSettings = new TeProjectSettings();
			s_settings.Add(cache, projectSettings);

			if (cache != null && cache.ServerName.Trim() != string.Empty &&
				cache.DatabaseName.Trim() != string.Empty)
			{
				string serverAndDb = cache.ServerName.Trim() + "\\" + cache.DatabaseName.Trim();
				if (FwApp.App != null)
				{
					RegistryKey key = FwApp.App.SettingsKey.CreateSubKey(serverAndDb);
					if (key != null)
					{
						projectSettings.m_fSendSyncMessages =
							((int)key.GetValue("SendSyncMessage", 1) == 1);
						projectSettings.m_fReceiveSyncMessages =
							((int)key.GetValue("ReceiveSyncMessage", 0) == 1);
						projectSettings.m_fShowSpellingErrors =
							((int)key.GetValue("ShowSpellingErrors", 0) == 1);
					}
				}
			}
			return projectSettings;
		}