📄 usersetdata!1.cs
字号:
namespace Imps.Client.Core
{
using System;
public class UserSetData<T> : IDataCanProposed
{
private T _contactSet;
private ProposedData<T> _data;
public UserSetData(T contactSetValue)
{
this._contactSet = contactSetValue;
this._data = null;
}
public UserSetData(T contactSetValue, T value)
{
this._contactSet = contactSetValue;
this._data = new ProposedData<T>(value);
}
public bool Equals(UserSetData<T> val)
{
if ((val != null) && object.Equals(this._contactSet, val._contactSet))
{
return object.Equals(this._data, val._data);
}
return false;
}
public override bool Equals(object other)
{
if (other is UserSetData<T>)
{
return this.Equals((UserSetData<T>) other);
}
if (other is T)
{
return object.Equals(this.Value, (T) other);
}
return false;
}
public override int GetHashCode()
{
int hashCode = this._contactSet.GetHashCode();
if (this._data != null)
{
hashCode &= this._data.GetHashCode();
}
return hashCode;
}
public static explicit operator UserSetData<T>(T value)
{
return new UserSetData<T>(value);
}
public static implicit operator T(UserSetData<T> value)
{
return value.Value;
}
public void RemoveProposedValue()
{
if (this._data != null)
{
this._data.RemoveProposedValue();
}
}
public override string ToString()
{
if (object.Equals(null, this.Value))
{
return string.Empty;
}
return this.Value.ToString();
}
public T ContactSetValue
{
get
{
return this._contactSet;
}
internal set
{
this._contactSet = value;
}
}
private ProposedData<T> Data
{
get
{
if (this._data == null)
{
this._data = new ProposedData<T>();
}
return this._data;
}
}
public bool HasProposedValue
{
get
{
if (this._data != null)
{
return this._data.HasProposedValue;
}
return false;
}
}
object IDataCanProposed.ProposedValue
{
get
{
if ((this._data != null) && (this._data != null))
{
return this._data.ProposedValue;
}
return null;
}
}
public T OriginalValue
{
get
{
return this.Data.OriginalValue;
}
}
public T ProposedValue
{
get
{
return this.Data.ProposedValue;
}
set
{
this.Data.ProposedValue = value;
}
}
public T Value
{
get
{
return this.Data.Value;
}
set
{
this.Data.Value = value;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -