예제 #1
0
        private static void InitializeNamespace()
        {
            LoadHelp2Config();

            if (string.IsNullOrEmpty(defaultNamespaceName))
            {
                return;
            }

            session = null;

            HtmlHelp2Dialog initDialog = new HtmlHelp2Dialog();

            try
            {
                initDialog.Text        = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpUpdateCaption}");
                initDialog.ActionLabel = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpUpdateInProgress}");
                initDialog.Show();
                Application.DoEvents();

                currentSelectedFilterQuery = string.Empty;
                currentSelectedFilterName  = string.Empty;

                session = new HxSession();
                session.Initialize(String.Format(CultureInfo.InvariantCulture, "ms-help://{0}", defaultNamespaceName), 0);
                namespaceFilters = session.GetFilterList();

                ReloadDefaultPages();
                ReloadFTSSystem();
                ReloadDynamicHelpSystem();

                LoggingService.Info("Help 2.0: Service sucessfully loaded");
            }
            catch (System.Runtime.InteropServices.COMException cEx)
            {
                LoggingService.Error("Help 2.0: Cannot not initialize service; " + cEx.ToString());
                session = null;
            }
            finally
            {
                initDialog.Dispose();
            }
        }
		private static void InitializeNamespace()
		{
			LoadHelp2Config();
			
			if (string.IsNullOrEmpty(defaultNamespaceName))
			{
				return;
			}

			session = null;

			HtmlHelp2Dialog initDialog = new HtmlHelp2Dialog();
			try
			{
				initDialog.Text            = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpUpdateCaption}");
				initDialog.ActionLabel     = StringParser.Parse("${res:AddIns.HtmlHelp2.HelpUpdateInProgress}");
				initDialog.Show();
				Application.DoEvents();

				currentSelectedFilterQuery = string.Empty;
				currentSelectedFilterName  = string.Empty;

				session                    = new HxSession();
				session.Initialize(String.Format(CultureInfo.InvariantCulture, "ms-help://{0}", defaultNamespaceName), 0);
				namespaceFilters           = session.GetFilterList();

				ReloadDefaultPages();
				ReloadFTSSystem();
				ReloadDynamicHelpSystem();

				LoggingService.Info("Help 2.0: Service sucessfully loaded");
			}
			catch (System.Runtime.InteropServices.COMException cEx)
			{
				LoggingService.Error("Help 2.0: Cannot not initialize service; " + cEx.ToString());
				session = null;
			}
			finally
			{
				initDialog.Dispose();
			}
		}