示例#1
0
        public static void LoadConfiguration()
        {
            Assembly thisAss = Assembly.GetExecutingAssembly();

            ResourceService.RegisterStrings("HtmlHelp2.StringResources", thisAss);
            ResourceService.RegisterImages("HtmlHelp2.BitmapResources", thisAss);

            string configFile = Path.Combine(PropertyService.ConfigDirectory, "help2environment.xml");

            if (!File.Exists(configFile))
            {
                return;
            }
            try
            {
                XmlSerializer serialize = new XmlSerializer(typeof(HtmlHelp2Options));
                TextReader    file      = new StreamReader(configFile);
                config = (HtmlHelp2Options)serialize.Deserialize(file);
                file.Close();

                LoggingService.Info("Help 2.0: Configuration successfully loaded");
            }
            catch (InvalidOperationException)
            {
                LoggingService.Error("Help 2.0: Error while trying to load configuration");
            }
        }
示例#2
0
        public static void LoadConfiguration()
        {
            string configFile = Path.Combine(PropertyService.ConfigDirectory, "help2environment.xml");

            if (!File.Exists(configFile))
            {
                return;
            }
            try
            {
                XmlSerializer serialize = new XmlSerializer(typeof(HtmlHelp2Options));
                TextReader    file      = new StreamReader(configFile);
                config = (HtmlHelp2Options)serialize.Deserialize(file);
                file.Close();

                LoggingService.Info("Help 2.0: Configuration successfully loaded");
            }
            catch (InvalidOperationException)
            {
                LoggingService.Error("Help 2.0: Error while trying to load configuration");
            }
        }
		public static void LoadConfiguration()
		{
			string configFile = Path.Combine(PropertyService.ConfigDirectory, "help2environment.xml");
			if (!File.Exists(configFile))
			{
				return;
			}
			try
			{
				XmlSerializer serialize = new XmlSerializer(typeof(HtmlHelp2Options));
				TextReader file = new StreamReader(configFile);
				config = (HtmlHelp2Options)serialize.Deserialize(file);
				file.Close();
	
				LoggingService.Info("Help 2.0: Configuration successfully loaded");
			}
			catch (InvalidOperationException)
			{
				LoggingService.Error("Help 2.0: Error while trying to load configuration");
			}
		}