当前位置: 首页>>代码示例>>C#>>正文


C# MethodReturnEventArgs类代码示例

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


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


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