📄 settingscollection.cs
字号:
namespace ElementIT.PowUpload
{
using System;
using System.Collections.Specialized;
using System.Reflection;
public class SettingsCollection : NameObjectCollectionBase
{
private bool _isCommonSettingsCol;
internal DateTime _timeCreated = DateTime.MinValue;
internal SettingsCollection(bool isCommonSettingsCol)
{
this._timeCreated = DateTime.Now;
this._isCommonSettingsCol = isCommonSettingsCol;
}
internal bool HasKey(string Name)
{
for (int i = 0; i < base.Keys.Count; i++)
{
if (string.Compare(base.Keys[i], Name, true) == 0)
{
return true;
}
}
return false;
}
public object this[string Name]
{
get
{
if (this.HasKey(Name))
{
return base.BaseGet(Name);
}
if (this._isCommonSettingsCol)
{
return null;
}
return Settings.CommonSettings[Name];
}
set
{
if (this.HasKey(Name))
{
base.BaseSet(Name, value);
}
else
{
base.BaseAdd(Name, value);
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -