Load() private method

private Load ( string fileName ) : bool
fileName string
return bool
        public void Init()
        {
            lock (this)
            {
                if (config != null)
                {
                    return;
                }

                ConfigurationData data = new ConfigurationData();
                if (data.LoadString(GetBundledMachineConfig()))
                {
                    // do nothing
                }
                else
                {
                    if (!data.Load(GetMachineConfigPath()))
                    {
                        throw new ConfigurationException("Cannot find " + GetMachineConfigPath());
                    }
                }
                string appfile = GetAppConfigPath();
                if (appfile == null)
                {
                    config = data;
                    return;
                }

                ConfigurationData appData = new ConfigurationData(data);
                if (appData.Load(appfile))
                {
                    config = appData;
                }
                else
                {
                    config = data;
                }
            }
        }
Exemplo n.º 2
0
		public void Init ()
		{
			lock (this) {
				if (config != null)
					return;

				ConfigurationData data = new ConfigurationData ();
				if (data.LoadString (GetBundledMachineConfig ())) {
					// do nothing
				} else {
					if (!data.Load (GetMachineConfigPath ()))
						throw new ConfigurationException ("Cannot find " + GetMachineConfigPath ());

				}
				string appfile = GetAppConfigPath ();
				if (appfile == null) {
					config = data;
					return;
				}

				ConfigurationData appData = new ConfigurationData (data);
				if (appData.Load (appfile))
					config = appData;
				else
					config = data;
			}
		}