public static AppConfigManager GetInstance(IErrorReport errorReport, IUserInterfaceProvider userIP)
 {
     if (instance == null)
     {
         instance = new AppConfigManager(errorReport, userIP);
     }
     return(instance);
 }
 static AppConfigManager()
 {
     instance                 = null;
     configFilePath           = null;
     registeredPersistObjects = new List <IPersistStatus>();
     try
     {
         string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
         configFilePath = (folderPath.EndsWith(new string(new char[1]
         {
             Path.DirectorySeparatorChar
         }), StringComparison.CurrentCultureIgnoreCase) ? (folderPath + Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase) + ".settings") : (folderPath + Path.DirectorySeparatorChar.ToString() + Path.GetFileName(Assembly.GetExecutingAssembly().CodeBase) + ".settings"));
     }
     catch (Exception e)
     {
         ExceptionManager.GeneralExceptionFilter(e);
         configFilePath = null;
     }
 }
Exemple #3
0
        public void Initialize(AppConfigManager config, bool promptUser)
        {
            this.config     = config;
            this.promptUser = promptUser;
            CustomFilterOptionSettings customFilterOptionSettings = config.LoadCustomFilterOptionSettings();

            if (customFilterOptionSettings != null)
            {
                if (customFilterOptionSettings.ShowWCFTraces)
                {
                    chkShowWCFTraces.Checked = true;
                }
                if (customFilterOptionSettings.ShowTransfer)
                {
                    chkTransfer.Checked = true;
                }
                if (customFilterOptionSettings.ShowMessageSentReceived)
                {
                    chkMessageSentReceived.Checked = true;
                }
                if (customFilterOptionSettings.ShowSecurityMessage)
                {
                    chkShowSMs.Checked = true;
                }
                if (customFilterOptionSettings.ShowReliableMessage)
                {
                    chkShowRMs.Checked = true;
                }
                if (customFilterOptionSettings.ShowTransactionMessage)
                {
                    chkShowTMs.Checked = true;
                }
                UpdateEnabledStatusForWCFOptions(chkShowWCFTraces.Checked);
            }
            isInitializing = false;
        }
 public CustomFilterManager(AppConfigManager configManager, XmlNode rootNode, IErrorReport errorReport)
 {
     this.errorReport   = errorReport;
     this.configManager = configManager;
     currentFilters     = LoadCustomFilters(rootNode, reportErrors: false);
 }