/// <summary>
 /// Copies the elements of the specified <see cref="BaseConfigInfo">BaseConfigInfo</see> array to the end of the collection.
 /// </summary>
 /// <param name="value">An array of type <see cref="BaseConfigInfo">BaseConfigInfo</see> containing the Components to add to the collection.</param>
 public void AddRange(BaseConfigInfo[] value)
 {
     for (int i = 0; (i < value.Length); i = (i + 1))
     {
         this.Add(value[i]);
     }
 }
Exemple #2
0
 /// <summary>
 /// 静态构造函数初始化相应实例和定时器
 /// </summary>
 static BaseConfigs()
 {
     m_configinfo = BaseConfigFileManager.LoadConfig();
     baseConfigTimer.AutoReset = true;
     baseConfigTimer.Enabled = true;
     baseConfigTimer.Elapsed += new System.Timers.ElapsedEventHandler(Timer_Elapsed);
     baseConfigTimer.Start();
 }
Exemple #3
0
 /// <summary>
 /// 重设配置类实例
 /// </summary>
 public static void ResetConfig()
 {
     m_configinfo = BaseConfigFileManager.LoadConfig();
 }
Exemple #4
0
 /// <summary>
 /// 保存配置实例
 /// </summary>
 /// <param name="baseconfiginfo"></param>
 /// <returns></returns>
 public static bool SaveConfig(BaseConfigInfo baseconfiginfo)
 {
     BaseConfigFileManager acfm = new BaseConfigFileManager();
     BaseConfigFileManager.ConfigInfo = baseconfiginfo;
     return acfm.SaveConfig();
 }
 /// <summary>
 /// Gets a value indicating whether the collection contains the specified <see cref="BaseConfigInfoCollection">BaseConfigInfoCollection</see>.
 /// </summary>
 /// <param name="value">The <see cref="BaseConfigInfoCollection">BaseConfigInfoCollection</see> to search for in the collection.</param>
 /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
 public bool Contains(BaseConfigInfo value)
 {
     return this.List.Contains(value);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseConfigInfoCollection">BaseConfigInfoCollection</see> class containing the specified array of <see cref="BaseConfigInfo">BaseConfigInfo</see> Components.
 /// </summary>
 /// <param name="value">An array of <see cref="BaseConfigInfo">BaseConfigInfo</see> Components with which to initialize the collection. </param>
 public BaseConfigInfoCollection(BaseConfigInfo[] value)
 {
     this.AddRange(value);
 }
 public int Add(BaseConfigInfo value)
 {
     return this.List.Add(value);
 }
 public void Remove(BaseConfigInfo value)
 {
     List.Remove(value);
 }
 public void Insert(int index, BaseConfigInfo value)
 {
     List.Insert(index, value);
 }
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="BaseConfigInfoCollection">BaseConfigInfoCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="BaseConfigInfoCollection">BaseConfigInfoCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(BaseConfigInfo value)
 {
     return this.List.IndexOf(value);
 }
 /// <summary>
 /// Copies the collection Components to a one-dimensional <see cref="T:System.Array">Array</see> instance beginning at the specified index.
 /// </summary>
 /// <param name="array">The one-dimensional <see cref="T:System.Array">Array</see> that is the destination of the values copied from the collection.</param>
 /// <param name="index">The index of the array at which to begin inserting.</param>
 public void CopyTo(BaseConfigInfo[] array, int index)
 {
     this.List.CopyTo(array, index);
 }
 /// <summary>
 /// 初始化文件修改时间和对象实例
 /// </summary>
 static BaseConfigFileManager()
 {
     m_fileoldchange = System.IO.File.GetLastWriteTime(ConfigFilePath);
     m_configinfo = (BaseConfigInfo)DefaultConfigFileManager.DeserializeInfo(ConfigFilePath, typeof(BaseConfigInfo));
 }