Example #1
0
        static AddinAuthoringService()
        {
            if (IdeApp.IsInitialized)
            {
                IdeApp.ProjectOperations.EndBuild += OnEndBuild;
            }

            configFile = Path.Combine(PropertyService.ConfigPath, "AddinAuthoring.config");
            if (File.Exists(configFile))
            {
                try {
                    XmlDataSerializer ser = new XmlDataSerializer(new DataContext());
                    StreamReader      sr  = new StreamReader(configFile);
                    using (sr) {
                        config = (AddinAuthoringServiceConfig)ser.Deserialize(new XmlTextReader(sr), typeof(AddinAuthoringServiceConfig));
                    }
                }
                catch (Exception ex) {
                    LoggingService.LogError("Could not load add-in authoring service configuration", ex);
                }
            }
            if (config == null)
            {
                config = new AddinAuthoringServiceConfig();
            }
        }
		static AddinAuthoringService ()
		{
			if (IdeApp.IsInitialized) {
				IdeApp.ProjectOperations.EndBuild += OnEndBuild;
			}
			
			configFile = Path.Combine (PropertyService.ConfigPath, "AddinAuthoring.config");
			if (File.Exists (configFile)) {
				try {
					XmlDataSerializer ser = new XmlDataSerializer (new DataContext ());
					StreamReader sr = new StreamReader (configFile);
					using (sr) {
						config = (AddinAuthoringServiceConfig) ser.Deserialize (new XmlTextReader (sr), typeof(AddinAuthoringServiceConfig));
					}
				}
				catch (Exception ex) {
					LoggingService.LogError ("Could not load add-in authoring service configuration", ex);
				}
			}
			if (config == null)
				config = new AddinAuthoringServiceConfig ();
		}