111,130
社区成员
发帖
与我相关
我的任务
分享
internal class SSystem : SalesTrack3.WS_SSystem.SSystem
{
public SSystem()
{
WS_SSystem.CSoapHeader sh = new SalesTrack3.WS_SSystem.CSoapHeader();
sh.ClientDomainName = Environment.UserDomainName;
sh.ClientUserName = Environment.UserName;
sh.Time = DateTime.Now;
sh.ClientPassword = CSystem.getPWD(sh.Time);
sh.id = CSystem.getSID();
CSoapHeaderValue = sh;
UseDefaultCredentials = true;
}
}
internal class SVisitRecord : SalesTrack3.WS_SVisitRecord.SVisitRecord
{
public SVisitRecord()
{
WS_SVisitRecord.CSoapHeader sh = new SalesTrack3.WS_SVisitRecord.CSoapHeader();
sh.ClientDomainName = Environment.UserDomainName;
sh.ClientUserName = Environment.UserName;
sh.Time = DateTime.Now;
sh.ClientPassword = CSystem.getPWD(sh.Time);
sh.id = CSystem.getSID();
CSoapHeaderValue = sh;
UseDefaultCredentials = true;
}
}
namespace WindowsApplication21
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
((I)new A()).setm("1");
((I)new A()).setn(1);
((I)new B()).setm("2");
((I)new B()).setn(2);
}
}
interface I
{
void setm(string M);
void setn(int N);
}
class A:I
{
string m;
int n;
public void setm(string M)
{
m = M;
}
public void setn(int N)
{
n = N;
}
}
class B : I
{
string m;
int n;
public void setm(string M)
{
m = M;
}
public void setn(int N)
{
n = N;
}
}
}
static List<T> SetAttributes<T>(List<T> list) where T : Permission
{
foreach (T t in list)
{
Dictionary<string, object> dictionary = (Dictionary<string, object>)Sunivo.Framework.Utility.BinarySerializer.Deserializer(t.PermissionBytes);
//填充属性
foreach (PropertyInfo info in t.GetType().GetProperties())
{
if (info.GetCustomAttributes(typeof(SunivoAttribute), false).Length == 0)
continue;
object value = info.GetValue(t, null);
if (info.GetSetMethod() == null || !dictionary.ContainsKey(info.Name))
continue;
info.GetSetMethod().Invoke(t, new object[] { dictionary[info.Name] });
}
...........