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


C# Core.GetType方法代码示例

本文整理汇总了C#中Core.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Core.GetType方法的具体用法?C# Core.GetType怎么用?C# Core.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core的用法示例。


在下文中一共展示了Core.GetType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ResolveNotificationParameters

		public NotificationParameter[] ResolveNotificationParameters(Core.Notifications.Notification notification)
		{
			var retVal = new List<NotificationParameter>();

			List<PropertyInfo> properties = notification.GetType().GetProperties().Where(p => p.GetCustomAttributes(typeof(NotificationParameterAttribute), true).Any()).ToList();

			if (properties.Count > 0)
			{
				foreach (var property in properties)
				{
					var attributes = property.GetCustomAttributes(typeof(NotificationParameterAttribute), true);
					retVal.Add(new NotificationParameter
					{
						ParameterName = property.Name,
						ParameterDescription = attributes.Length > 0 ? ((NotificationParameterAttribute)(attributes[0])).Description : string.Empty,
						ParameterCodeInView = GetLiquidCodeOfParameter(property.Name),
                        IsDictionary = property.PropertyType.IsAssignableFrom(typeof(IDictionary)),
                        IsArray = property.PropertyType.IsArray,
                        Type = GetParameterType(property.PropertyType.Name)
                    });
				}
			}

			return retVal.ToArray();
		}
开发者ID:VirtoCommerce,项目名称:vc-internal,代码行数:25,代码来源:LiquidNotificationTemplateResolver.cs

示例2: ResolveNotificationParameters

		public NotificationParameter[] ResolveNotificationParameters(Core.Notification.Notification notification)
		{
			var retVal = new List<NotificationParameter>();

			var attributeCollection = TypeDescriptor.GetAttributes(notification.GetType());
			var attribute = (LiquidTypeAttribute)attributeCollection[typeof(LiquidTypeAttribute)];
			if (attribute != null)
			{
				foreach (var property in attribute.AllowedMembers)
				{
					var attributes = notification.GetType().GetProperty(property).GetCustomAttributes(typeof(DescriptionAttribute), true);
					retVal.Add(new NotificationParameter
					{
						ParameterName = property,
						ParameterDescription = attributes.Length > 0 ? ((DescriptionAttribute)(attributes[0])).Description : string.Empty,
						ParameterCodeInView = GetLiquidCodeOfParameter(property)
					});
				}
			}

			return retVal.ToArray();
		}
开发者ID:tuyndv,项目名称:vc-community,代码行数:22,代码来源:LiquidNotificationTemplateResolver.cs

示例3: ResolveTemplate

		public void ResolveTemplate(Core.Notifications.Notification notification)
		{
			var parameters = ResolveNotificationParameters(notification);
			Dictionary<string, object> myDict = new Dictionary<string, object>();
			foreach(var parameter in parameters)
			{
				myDict.Add(parameter.ParameterName, notification.GetType().GetProperty(parameter.ParameterName).GetValue(notification));
			}

			Template templateSubject = Template.Parse(notification.NotificationTemplate.Subject);
			notification.Subject = templateSubject.Render(Hash.FromDictionary(myDict));

			Template templateBody = Template.Parse(notification.NotificationTemplate.Body);
			notification.Body = templateBody.Render(Hash.FromDictionary(myDict));
		}
开发者ID:nisarzahid,项目名称:vc-community,代码行数:15,代码来源:LiquidNotificationTemplateResolver.cs

示例4: ShouldExecute

        public override bool ShouldExecute(Core.Item item, Core.Enums.ItemEvent itemEvent)
        {
            var type = item.GetType();

            if (type == typeof(ContentPropertyData))
            {
                var propertyData = (ContentPropertyData)item;

                var rightEvent = (itemEvent == ItemEvent.Extracting || itemEvent == ItemEvent.Packaging);

                if(!rightEvent)
                    return false;

                var hasType = propertyData.Data.Any(x => x.Value != null && DataTypeIds.Contains(x.DataTypeEditor));
                return hasType;

            }
            else
            {
                var dataType = (DataType)item;
                return ( DataTypeIds.Contains(dataType.DataEditorId));
            }
        }
开发者ID:jayvin,项目名称:Courier,代码行数:23,代码来源:MultiPropertyDataResolverProvider.cs

示例5: HandleMessage

 public override void HandleMessage(Core.Messages.AMessage message, VSPCContext context)
 {
     if (message is UserClickedLoginMessage)
         InitSimConnect(context);
     else if (message is UserClickedLogoffMessage)
         CloseConnection();
     else if (message is TrafficPositionReportMessage)
         HandleTrafficPositionReport((TrafficPositionReportMessage)message);
     else
         Logger.Error("Unexpected message type received in SimConnectInterface: " + message.GetType().Name);
 }
开发者ID:chembergj,项目名称:VSPC,代码行数:11,代码来源:SimConnectInterface.cs

示例6: SearchFilterByIdentifyObject

 public SearchFilterByIdentifyObject(Core.IdentifiableObject obj)
     : this(obj, obj.GetType().Name)
 {
 }
开发者ID:Minatron,项目名称:Minatron,代码行数:4,代码来源:SearchFilterByIdentifyObject.cs

示例7: HandleAlertCallback

 private static void HandleAlertCallback(Core.Alert a)
 {
     using (a)
     {
         Action<object> run;
         if (Alert2Func.TryGetValue(a.GetType(), out run))
         {
             run(a);
         }
     }
 }
开发者ID:ChristianSacramento,项目名称:Tsunami,代码行数:11,代码来源:SessionManager.cs


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