本文整理汇总了C#中ClassA.BeginSave方法的典型用法代码示例。如果您正苦于以下问题:C# ClassA.BeginSave方法的具体用法?C# ClassA.BeginSave怎么用?C# ClassA.BeginSave使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassA
的用法示例。
在下文中一共展示了ClassA.BeginSave方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: btnAuthorizationD_Click
private void btnAuthorizationD_Click(object sender, RoutedEventArgs e)
{
txtAuthorizationD.Text = String.Empty;
SLPrincipal.Logout();
SLPrincipal.Login("TestUser", "1234", "", (o, e2) =>
{
bool pass = true;
try
{
try
{
ClassA classA = new ClassA();
classA.A = "test";
classA.B = "test";
classA.BeginSave();
pass = false;
}
catch (SecurityException ex)
{ }
ClassB classB = new ClassB();
try
{
classB.A = "test";
pass = false;
}
catch (SecurityException ex)
{ }
classB.B = "test";
if (classB.B != "test")
pass = false;
}
catch (Exception ex)
{
pass = false;
}
if (pass)
{
txtAuthorizationD.Text = "Pass";
}
else
{
txtAuthorizationD.Text = "Fail";
}
});
}
示例2: btnAuthorizationC_Click
private void btnAuthorizationC_Click(object sender, RoutedEventArgs e)
{
txtAuthorizationC.Text = String.Empty;
SLPrincipal.Logout();
SLPrincipal.Login("TestUser", "1234", "PropertyARole", (o, e2) =>
{
bool pass = true;
try
{
ClassB classB = new ClassB();
classB.A = "test";
classB.B = "test";
if (classB.A != "test" || classB.B != "test")
pass = false;
if (pass == true)
{
ClassA classA = new ClassA();
classA.A = "test";
classA.B = "test";
classA.Saved += ((savedObj, savedArgs) =>
{
if (savedArgs.Error != null)
{
txtAuthorizationC.Text = "Pass";
}
else
{
txtAuthorizationC.Text = "Fail";
};
}
);
classA.BeginSave();
}
else
{
txtAuthorizationC.Text = "Fail";
}
}
catch (Exception ex)
{
txtAuthorizationC.Text = "Fail";
}
}
);
}