本文整理汇总了C#中PropertyGetterEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# PropertyGetterEventArgs类的具体用法?C# PropertyGetterEventArgs怎么用?C# PropertyGetterEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyGetterEventArgs类属于命名空间,在下文中一共展示了PropertyGetterEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: get_CodeTemplate
public static void get_CodeTemplate(Property obj, PropertyGetterEventArgs<string> e)
{
StringBuilder sb = new StringBuilder();
string type = obj.ObjectClass != null ? obj.ObjectClass.Name : "<<TYPE>>";
string propType = obj.GetPropertyTypeString();
sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "get", obj.Name, type, "PropertyGetterEventArgs", propType);
sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "preSet", obj.Name, type, "PropertyPreSetterEventArgs", propType);
sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3}<{4}> e)\n{{\n}}\n\n", "postSet", obj.Name, type, "PropertyPostSetterEventArgs", propType);
sb.AppendFormat("[Invocation]\npublic static void {0}_{1}({2} obj, {3} e)\n{{\n\te.IsValid = obj.{1} == ...;\n\te.Error = e.IsValid ? string.Empty : \"<Error>\";\n}}\n\n", "isValid", obj.Name, type, "PropertyIsValidEventArgs");
e.Result = sb.ToString();
}
示例2: get_CodeTemplate
public static void get_CodeTemplate(ObjectClass obj, PropertyGetterEventArgs<string> e)
{
StringBuilder sb = new StringBuilder();
string type = obj.Name;
sb.AppendFormat("[Invocation]\npublic static void ToString({0} obj, MethodReturnEventArgs<string> e)\n{{\n}}\n\n", type);
sb.AppendFormat("[Invocation]\npublic static void NotifyPreSave({0} obj)\n{{\n}}\n\n", type);
sb.AppendFormat("[Invocation]\npublic static void NotifyPostSave({0} obj)\n{{\n}}\n\n", type);
sb.AppendFormat("[Invocation]\npublic static void NotifyCreated({0} obj)\n{{\n}}\n\n", type);
sb.AppendFormat("[Invocation]\npublic static void NotifyDeleting({0} obj)\n{{\n}}\n\n", type);
sb.AppendFormat("[Invocation]\npublic static void ObjectIsValid({0} obj, ObjectIsValidEventArgs e)\n{{\n}}\n\n", type);
e.Result = sb.ToString();
}
示例3: get_CodeTemplate
public static void get_CodeTemplate(Method obj, PropertyGetterEventArgs<string> e)
{
StringBuilder sb = new StringBuilder();
string objParameter;
if (obj.ObjectClass != null)
{
objParameter = string.Format("{0} obj", obj.ObjectClass.Name);
}
else
{
objParameter = "<<TYPE>> obj";
}
sb.AppendFormat("[Invocation]\npublic static void {0}({1}", obj.Name, objParameter);
var returnParam = obj.GetReturnParameter();
if (returnParam != null)
{
sb.AppendFormat(", MethodReturnEventArgs<{0}> e", returnParam.GetParameterTypeString());
}
foreach (var param in obj.Parameter.Where(p => !p.IsReturnParameter))
{
sb.AppendFormat(", {0} {1}",
param.GetParameterTypeString(),
param.Name);
}
sb.AppendLine(")\n{\n}");
sb.AppendLine();
sb.AppendFormat("[Invocation]\npublic static void {0}CanExec({1}, MethodReturnEventArgs<bool> e)\n{{\n}}\n", obj.Name, objParameter);
sb.AppendLine();
sb.AppendFormat("[Invocation]\npublic static void {0}CanExecReason({1}, MethodReturnEventArgs<string> e)\n{{\n}}\n", obj.Name, objParameter);
e.Result = sb.ToString();
}
示例4: get_Description
public static void get_Description(AccessControl obj, PropertyGetterEventArgs<string> e)
{
if (obj is GroupMembership)
{
var grp = (GroupMembership)obj;
e.Result = string.Format("Group {0} has {1} rights", grp.Group != null ? grp.Group.Name : "<null>", obj.Rights);
}
else if (obj is RoleMembership)
{
var role = (RoleMembership)obj;
var navigators = new List<string>();
ObjectClass nextType = obj.ObjectClass;
foreach (var rel in role.Relations)
{
if (rel == null)
{
// Only during dehydration - fix this call!
continue;
}
if (rel.A != null && rel.A.Type == nextType)
{
navigators.Add(rel.A.Navigator != null ? rel.A.Navigator.Name : "<?>");
nextType = rel.B.Type;
}
else if (rel.B != null && rel.B.Type == nextType)
{
navigators.Add(rel.B.Navigator != null ? rel.B.Navigator.Name : "<?>");
nextType = rel.A.Type;
}
else
{
navigators.Add("<?>");
}
}
e.Result = string.Format("{0} has {1} rights", string.Join(".", navigators), obj.Rights);
}
}
示例5: TriggerFetchBaseWorkScheduleAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Calendar.WorkSchedule> TriggerFetchBaseWorkScheduleAsync()
{
if (_triggerFetchBaseWorkScheduleTask != null) return _triggerFetchBaseWorkScheduleTask;
if (_fk_BaseWorkSchedule.HasValue)
_triggerFetchBaseWorkScheduleTask = Context.FindAsync<Zetbox.App.Calendar.WorkSchedule>(_fk_BaseWorkSchedule.Value);
else
_triggerFetchBaseWorkScheduleTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Calendar.WorkSchedule>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchBaseWorkScheduleTask.OnResult(t =>
{
if (OnBaseWorkSchedule_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Calendar.WorkSchedule>(t.Result);
OnBaseWorkSchedule_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchBaseWorkScheduleTask;
}
示例6: get_AufwandGes
public static void get_AufwandGes(Projekt obj, PropertyGetterEventArgs<double?> e)
{
e.Result = obj.Tasks.Sum(t => t.Aufwand);
}
示例7: TriggerFetchTestCustomObjects_One_NavAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Test.TestCustomObject> TriggerFetchTestCustomObjects_One_NavAsync()
{
if (_triggerFetchTestCustomObjects_One_NavTask != null) return _triggerFetchTestCustomObjects_One_NavTask;
if (_fk_TestCustomObjects_One_Nav.HasValue)
_triggerFetchTestCustomObjects_One_NavTask = Context.FindAsync<Zetbox.App.Test.TestCustomObject>(_fk_TestCustomObjects_One_Nav.Value);
else
_triggerFetchTestCustomObjects_One_NavTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Test.TestCustomObject>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchTestCustomObjects_One_NavTask.OnResult(t =>
{
if (OnTestCustomObjects_One_Nav_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Test.TestCustomObject>(t.Result);
OnTestCustomObjects_One_Nav_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchTestCustomObjects_One_NavTask;
}
示例8: get_Parent
public static void get_Parent(RelationEnd relEnd, PropertyGetterEventArgs<Relation> e)
{
e.Result = relEnd.AParent ?? relEnd.BParent;
}
示例9: TriggerFetchExcerptAsync
public Zetbox.API.Async.ZbTask<at.dasz.DocumentManagement.Excerpt> TriggerFetchExcerptAsync()
{
if (_triggerFetchExcerptTask != null) return _triggerFetchExcerptTask;
if (_fk_Excerpt.HasValue)
_triggerFetchExcerptTask = Context.FindAsync<at.dasz.DocumentManagement.Excerpt>(_fk_Excerpt.Value);
else
_triggerFetchExcerptTask = new Zetbox.API.Async.ZbTask<at.dasz.DocumentManagement.Excerpt>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchExcerptTask.OnResult(t =>
{
if (OnExcerpt_Getter != null)
{
var e = new PropertyGetterEventArgs<at.dasz.DocumentManagement.Excerpt>(t.Result);
OnExcerpt_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchExcerptTask;
}
示例10: TriggerFetchCompoundObjectDefinitionAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Base.CompoundObject> TriggerFetchCompoundObjectDefinitionAsync()
{
if (_triggerFetchCompoundObjectDefinitionTask != null) return _triggerFetchCompoundObjectDefinitionTask;
if (_fk_CompoundObjectDefinition.HasValue)
_triggerFetchCompoundObjectDefinitionTask = Context.FindAsync<Zetbox.App.Base.CompoundObject>(_fk_CompoundObjectDefinition.Value);
else
_triggerFetchCompoundObjectDefinitionTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.CompoundObject>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchCompoundObjectDefinitionTask.OnResult(t =>
{
if (OnCompoundObjectDefinition_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Base.CompoundObject>(t.Result);
OnCompoundObjectDefinition_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchCompoundObjectDefinitionTask;
}
示例11: TriggerFetchAParentAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Base.Relation> TriggerFetchAParentAsync()
{
if (_triggerFetchAParentTask != null) return _triggerFetchAParentTask;
if (_fk_AParent.HasValue)
_triggerFetchAParentTask = Context.FindAsync<Zetbox.App.Base.Relation>(_fk_AParent.Value);
else
_triggerFetchAParentTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.Relation>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchAParentTask.OnResult(t =>
{
if (OnAParent_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Base.Relation>(t.Result);
OnAParent_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchAParentTask;
}
示例12: TriggerFetchTypeAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Base.ObjectClass> TriggerFetchTypeAsync()
{
if (_triggerFetchTypeTask != null) return _triggerFetchTypeTask;
if (_fk_Type.HasValue)
_triggerFetchTypeTask = Context.FindAsync<Zetbox.App.Base.ObjectClass>(_fk_Type.Value);
else
_triggerFetchTypeTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.ObjectClass>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchTypeTask.OnResult(t =>
{
if (OnType_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Base.ObjectClass>(t.Result);
OnType_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchTypeTask;
}
示例13: TriggerFetchViewModelDescriptorAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.GUI.ViewModelDescriptor> TriggerFetchViewModelDescriptorAsync()
{
if (_triggerFetchViewModelDescriptorTask != null) return _triggerFetchViewModelDescriptorTask;
if (_fk_ViewModelDescriptor.HasValue)
_triggerFetchViewModelDescriptorTask = Context.FindAsync<Zetbox.App.GUI.ViewModelDescriptor>(_fk_ViewModelDescriptor.Value);
else
_triggerFetchViewModelDescriptorTask = new Zetbox.API.Async.ZbTask<Zetbox.App.GUI.ViewModelDescriptor>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchViewModelDescriptorTask.OnResult(t =>
{
if (OnViewModelDescriptor_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.GUI.ViewModelDescriptor>(t.Result);
OnViewModelDescriptor_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchViewModelDescriptorTask;
}
示例14: TriggerFetchConstrainedAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Base.DataType> TriggerFetchConstrainedAsync()
{
if (_triggerFetchConstrainedTask != null) return _triggerFetchConstrainedTask;
if (_fk_Constrained.HasValue)
_triggerFetchConstrainedTask = Context.FindAsync<Zetbox.App.Base.DataType>(_fk_Constrained.Value);
else
_triggerFetchConstrainedTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Base.DataType>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchConstrainedTask.OnResult(t =>
{
if (OnConstrained_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Base.DataType>(t.Result);
OnConstrained_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchConstrainedTask;
}
示例15: TriggerFetchMitarbeiterAsync
public Zetbox.API.Async.ZbTask<Zetbox.App.Projekte.Mitarbeiter> TriggerFetchMitarbeiterAsync()
{
if (_triggerFetchMitarbeiterTask != null) return _triggerFetchMitarbeiterTask;
if (_fk_Mitarbeiter.HasValue)
_triggerFetchMitarbeiterTask = Context.FindAsync<Zetbox.App.Projekte.Mitarbeiter>(_fk_Mitarbeiter.Value);
else
_triggerFetchMitarbeiterTask = new Zetbox.API.Async.ZbTask<Zetbox.App.Projekte.Mitarbeiter>(Zetbox.API.Async.ZbTask.Synchron, () => null);
_triggerFetchMitarbeiterTask.OnResult(t =>
{
if (OnMitarbeiter_Getter != null)
{
var e = new PropertyGetterEventArgs<Zetbox.App.Projekte.Mitarbeiter>(t.Result);
OnMitarbeiter_Getter(this, e);
t.Result = e.Result;
}
});
return _triggerFetchMitarbeiterTask;
}