• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MethodReturnEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MethodReturnEventArgs的典型用法代码示例。如果您正苦于以下问题:C# MethodReturnEventArgs类的具体用法?C# MethodReturnEventArgs怎么用?C# MethodReturnEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MethodReturnEventArgs类属于命名空间,在下文中一共展示了MethodReturnEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ToString

 public static void ToString(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
 {
     e.Result = string.Format("{0} (default: {1}) [{2}]",
         obj.Description,
         obj.DefaultEditorKind,
         string.IsNullOrWhiteSpace(obj.ViewModelTypeRef) ? "(no type)" : obj.ViewModelTypeRef);
 }
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:ViewModelDescriptorActions.cs


示例2: MakeStaticFile

 public static void MakeStaticFile(ImportedFile obj, MethodReturnEventArgs<StaticFile> e)
 {
     var ctx = obj.Context;
     var doc = ctx.Create<StaticFile>();
     MakeInternal(ctx, obj, doc);
     e.Result = doc;
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:ImportedFileActions.cs


示例3: ToString

 public static void ToString(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
 {
     e.Result = string.Format("{0} (default: {1}) [{2}]",
         obj.Description,
         obj.DefaultEditorKind,
         obj.ViewModelRef == null ? "(no type)" : obj.ViewModelRef.ToString());
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:ViewModelDescriptorActions.cs


示例4: AppliesTo

 public static void AppliesTo(FixedYearlyCalendarRule obj, MethodReturnEventArgs<System.Boolean> e, System.DateTime date)
 {
     if (obj.CheckValidDate(date))
     {
         e.Result = date.Day == obj.Day && date.Month == obj.Month;
     }
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:FixedYearlyCalendarRuleActions.cs


示例5: CreateNavigator

        public static void CreateNavigator(RelationEnd obj, MethodReturnEventArgs<ObjectReferenceProperty> e)
        {
            Relation rel = obj.AParent ?? obj.BParent;
            RelationEnd other = rel != null ? rel.GetOtherEnd(obj) : null;

            var nav = obj.Context.Create<ObjectReferenceProperty>();
            nav.CategoryTags = String.Empty;
            nav.ObjectClass = obj.Type;
            nav.RelationEnd = obj;
            nav.Module = rel != null ? rel.Module : null;

            if (other != null)
            {
                if (nav.GetIsList())
                {
                    if (nav.RelationEnd.Parent.GetOtherEnd(nav.RelationEnd).HasPersistentOrder)
                    {
                        nav.ValueModelDescriptor = obj.Context.FindPersistenceObject<ViewModelDescriptor>(ViewModelDescriptor_ObjectListModel);
                    }
                    else
                    {
                        nav.ValueModelDescriptor = obj.Context.FindPersistenceObject<ViewModelDescriptor>(ViewModelDescriptor_ObjectCollectionModel);
                    }
                }
                else
                {
                    nav.ValueModelDescriptor = obj.Context.FindPersistenceObject<ViewModelDescriptor>(ViewModelDescriptor_ObjectReferenceModel);
                }

                nav.Name = other.RoleName;
            }

            e.Result = nav;
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:34,代码来源:RelationEndActions.cs


示例6: GetRelationType

        public static void GetRelationType(Relation rel, MethodReturnEventArgs<RelationType> e)
        {
            if (rel == null)
            {
                throw new ArgumentNullException("rel");
            }
            if (rel.A == null)
            {
                throw new ArgumentNullException("rel", "rel.A is null");
            }
            if (rel.B == null)
            {
                throw new ArgumentNullException("rel", "rel.B is null");
            }

            if ((rel.A.Multiplicity.UpperBound() == 1 && rel.B.Multiplicity.UpperBound() > 1)
                || (rel.A.Multiplicity.UpperBound() > 1 && rel.B.Multiplicity.UpperBound() == 1))
            {
                e.Result = RelationType.one_n;
            }
            else if (rel.A.Multiplicity.UpperBound() > 1 && rel.B.Multiplicity.UpperBound() > 1)
            {
                e.Result = RelationType.n_m;
            }
            else if (rel.A.Multiplicity.UpperBound() == 1 && rel.B.Multiplicity.UpperBound() == 1)
            {
                e.Result = RelationType.one_one;
            }
            else
            {
                throw new InvalidOperationException(String.Format("Unable to find out RelationType: {0}:{1}", rel.A.Multiplicity, rel.B.Multiplicity));
            }
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:33,代码来源:RelationActions.cs


示例7: GetErrorText

        public static void GetErrorText(
            IntegerRangeConstraint obj,
            MethodReturnEventArgs<string> e,
            object constrainedObjectParam,
            object constrainedValueParam)
        {
            if (constrainedValueParam == null)
            {
                e.Result = null;
                return;
            }

            int v = (int)constrainedValueParam;
            if (obj.IsValid(constrainedObjectParam, constrainedValueParam))
            {
                e.Result = null;
            }
            else
            {
                StringBuilder result = new StringBuilder();
                if (v < obj.Min)
                    result.AppendFormat("{0} should be equal or greater than {1}", obj.ConstrainedProperty.Name, obj.Min);
                if (v > obj.Max)
                    result.AppendFormat("{0} should be equal or less than {1}", obj.ConstrainedProperty.Name, obj.Max);

                if (!String.IsNullOrEmpty(obj.Reason))
                {
                    result.Append(": ");
                    result.Append(obj.Reason);
                }

                e.Result = result.ToString();
            }
        }
开发者ID:daszat,项目名称:zetbox,代码行数:34,代码来源:IntegerRangeConstraintActions.cs


示例8: ToString

        public static void ToString(ObjectReferenceProperty obj, MethodReturnEventArgs<string> e)
        {
            e.Result = "-> " + e.Result;

            // already handled by base OnToString_Property()
            // ToStringHelper.FixupFloatingObjects(obj, e);
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:ObjectReferencePropertyActions.cs


示例9: GetErrorText

        public static void GetErrorText(
            StringRangeConstraint obj,
            MethodReturnEventArgs<string> e,
            object constrainedObjectParam,
            object constrainedValueParam)
        {
            if (obj.IsValid(constrainedObjectParam, constrainedValueParam))
            {
                e.Result = null;
            }
            else
            {
                constrainedValueParam = (constrainedValueParam ?? String.Empty);
                int length = constrainedValueParam.ToString().Length;
                StringBuilder result = new StringBuilder();
                if (length < obj.MinLength)
                    result.AppendFormat("{0} should be at least {1} characters long", obj.ConstrainedProperty.Name, obj.MinLength);
                if (obj.MaxLength != null && length > obj.MaxLength)
                    result.AppendFormat("{0} should be at most {1} characters long", obj.ConstrainedProperty.Name, obj.MaxLength);

                if (!String.IsNullOrEmpty(obj.Reason))
                {
                    result.Append(": ");
                    result.Append(obj.Reason);
                }

                e.Result = result.ToString();
            }
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:29,代码来源:StringRangeConstraintActions.cs


示例10: GetName

 public static void GetName(ViewModelDescriptor obj, MethodReturnEventArgs<string> e)
 {
     if (obj.ViewModelRef != null)
     {
         e.Result = string.Format("Gui.ViewModelDescriptors.{0}", Regex.Replace(obj.ViewModelRef.ToTypeName(), @"\W", "_"));
     }
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:ViewModelDescriptorActions.cs


示例11: CreateFilterModel

        public static void CreateFilterModel(Zetbox.App.GUI.SinglePropertyFilterConfiguration obj, MethodReturnEventArgs<IFilterModel> e)
        {
            var mdl = new SingleValueFilterModel();
            mdl.Label = obj.GetLabel();
            mdl.Required = obj.Required;
            mdl.ValueSource = FilterValueSource.FromProperty(obj.Property);

            mdl.ViewModelType = obj.ViewModelDescriptor;
            mdl.RequestedKind = obj.RequestedKind;

            mdl.FilterArguments.Add(new FilterArgumentConfig(obj.Property.GetDetachedValueModel(true), /*cfg.ArgumentViewModel ?? */ obj.Property.ValueModelDescriptor));
            if (obj.Property is StringProperty)
            {
                mdl.Operator = FilterOperators.Contains;
            }
            else if (obj.Property is EnumerationProperty)
            {
                mdl.RefreshOnFilterChanged = true;
            }
            else if (obj.Property is ObjectReferenceProperty)
            {
                mdl.RefreshOnFilterChanged = true;
            }
            e.Result = mdl;
        }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:25,代码来源:SinglePropertyFilterConfigurationActions.cs


示例12: AppliesTo

 public static void AppliesTo(DayOfWeekWorkScheduleRule obj, MethodReturnEventArgs<System.Boolean> e, System.DateTime date)
 {
     if (obj.CheckValidDate(date))
     {
         e.Result = (int)date.DayOfWeek == (int)obj.DayOfWeek;
     }
 }
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:DayOfWeekWorkScheduleRuleActions.cs


示例13: GetName

 public static void GetName(Sequence obj, MethodReturnEventArgs<string> e)
 {
     if (!string.IsNullOrEmpty(obj.Name) && obj.Module != null && !string.IsNullOrEmpty(obj.Module.Name))
     {
         e.Result = "Base.Sequences." + obj.Module.Name + "." + Regex.Replace(obj.Name, "\\W", "_");
     }
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:7,代码来源:SequenceActions.cs


示例14: CreateFilterModel

 public static void CreateFilterModel(Zetbox.App.GUI.MonthFilterConfiguration obj, MethodReturnEventArgs<IFilterModel> e, Zetbox.API.IZetboxContext ctx)
 {
     var mdl = MonthValueFilterModel.Create(FrozenContext, obj.GetLabel(), FilterValueSource.FromProperty(obj.Property), obj.IsCurrentMonthDefault ?? false);
     mdl.Required = obj.Required;
     mdl.RefreshOnFilterChanged = obj.RefreshOnFilterChanged;
     e.Result = mdl;
 }
开发者ID:daszat,项目名称:zetbox,代码行数:7,代码来源:MonthFilterConfigurationActions.cs


示例15: ToString

 public static void ToString(Event obj, MethodReturnEventArgs<System.String> e)
 {
     e.Result = string.Format("{0} - {1}: {2} ({3})",
         obj.IsAllDay ? obj.StartDate.ToShortDateString() : obj.StartDate.ToShortDateString() + " " + obj.StartDate.ToShortTimeString(),
         obj.IsAllDay ? obj.EndDate.ToShortDateString() : obj.EndDate.ToShortDateString() + " " + obj.EndDate.ToShortTimeString(),
         obj.Summary,
         obj.Location);
 }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:EventActions.cs


示例16: HandleBlobChange

 public static void HandleBlobChange(ImportedFile obj, MethodReturnEventArgs<Zetbox.App.Base.Blob> e, Zetbox.App.Base.Blob oldBlob, Zetbox.App.Base.Blob newBlob)
 {
     if (oldBlob != null && newBlob != oldBlob)
     {
         throw new InvalidOperationException("Changing blob on imported files is not allowed");
     }
     e.Result = newBlob;
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:8,代码来源:ImportedFileActions.cs


示例17: GetErrorText

 public static void GetErrorText(
     IsValidIdentifierConstraint obj,
     MethodReturnEventArgs<string> e,
     object constrainedObjectParam,
     object constrainedValueParam)
 {
     e.Result = string.Format("'{0}' is not a valid identifier", constrainedValueParam);
 }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:IsValidIdentifierConstraintActions.cs


示例18: GetErrorText

 public static void GetErrorText(
     NotNullableConstraint obj,
     MethodReturnEventArgs<string> e,
     object constrainedObjectParam,
     object constrainedValueParam)
 {
     e.Result = String.IsNullOrEmpty(obj.Reason) ? "Wert muss gesetzt sein" : String.Format("Wert muss gesetzt sein: {0}", obj.Reason);
 }
开发者ID:jrgcubano,项目名称:zetbox,代码行数:8,代码来源:NotNullableConstraintActions.cs


示例19: GetErrorText

 public static void GetErrorText(
     NotNullableConstraint obj,
     MethodReturnEventArgs<string> e,
     object constrainedObjectParam,
     object constrainedValueParam)
 {
     e.Result = String.IsNullOrWhiteSpace(obj.Reason) ? Strings.ErrorEmptyValue : String.Format("{0}: {1}", Strings.ErrorEmptyValue, obj.Reason);
 }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:NotNullableConstraintActions.cs


示例20: GetSummaryReport

 public static void GetSummaryReport(Projekt obj, MethodReturnEventArgs<System.Object> e, string title, Zetbox.App.Base.DateTimeRange range)
 {
     using (var rpt = _rptFactory())
     {
         ProjectReport.Call(rpt);
         rpt.Open("ProjectReport.pdf");
     }
 }
开发者ID:daszat,项目名称:zetbox,代码行数:8,代码来源:ProjektActions.cs



注:本文中的MethodReturnEventArgs类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MethodType类代码示例发布时间:2022-05-24
下一篇:
C# MethodReference类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap