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


C# ComponentModel.MemberDescriptor类代码示例

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


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

示例1: BindModel

     public object BindModel(
         ControllerContext controllerContext,
         ModelBindingContext bindingContext,
         MemberDescriptor memberDescriptor)
     {
         var RoomReservationViewModel = (RoomReservationViewModel)bindingContext.Model; 
         var form = controllerContext.HttpContext.Request.Form;
         
         var currencyid = form["RoomReservation_Payment.CurrencyId"];
         if (currencyid != "0")
             RoomReservationViewModel.RoomReservation_Payment.CurrencyId = int.Parse(currencyid.Split('|')[0]);
         RoomReservationViewModel.RoomReservation_Payment.PaymentById = int.Parse(form["RoomReservation_Payment.PaymentById"]);
         RoomReservationViewModel.RoomReservation_Payment.PaymentModeId = int.Parse(form["RoomReservation_Payment.PaymentModeId"]);
         RoomReservationViewModel.RoomReservation_Payment.BillTimeId = int.Parse(form["RoomReservation_Payment.BillTimeId"]);
         if (form["RoomReservation_Payment.Currency_Exchange_Rate"]!="")
         RoomReservationViewModel.RoomReservation_Payment.Currency_Exchange_Rate = decimal.Parse(form["RoomReservation_Payment.Currency_Exchange_Rate"]);
         RoomReservationViewModel.RoomReservation_Payment.App_Code =  form["RoomReservation_Payment.App_Code"] ;
         RoomReservationViewModel.RoomReservation_Payment.CC_ = form["RoomReservation_Payment.CC_"];
         if (form["RoomReservation_Payment.ExpiryMonth"] != "")
         RoomReservationViewModel.RoomReservation_Payment.ExpiryMonth = int.Parse(form["RoomReservation_Payment.ExpiryMonth"]);
         if (form["RoomReservation_Payment.ExpiryYear"] != "")
         RoomReservationViewModel.RoomReservation_Payment.ExpiryYear = int.Parse (form["RoomReservation_Payment.ExpiryYear"]);
         RoomReservationViewModel.RoomReservation_Payment.Total =  decimal.Parse(form["Reservation_Total"]);
         if (form["RoomReservation_Payment.GST_Charges"] != "")
         RoomReservationViewModel.RoomReservation_Payment.GST_Charges = decimal.Parse(form["RoomReservation_Payment.GST_Charges"]);
         if (form["RoomReservation_Payment.GST_Rate"] != "")
         RoomReservationViewModel.RoomReservation_Payment.GST_Rate = decimal.Parse(form["RoomReservation_Payment.GST_Rate"]);
         return RoomReservationViewModel.RoomReservation_Payment;
      
 }
开发者ID:DureSameen,项目名称:RoomReservation2,代码行数:30,代码来源:RoomReservation_PayementBinder.cs

示例2: GetProperty

		/// <summary>
		/// Gets the design item property for the specified member descriptor.
		/// </summary>
		public static DesignItemProperty GetProperty(this DesignItemPropertyCollection properties, MemberDescriptor md)
		{
			DesignItemProperty prop = null;

			var pd = md as PropertyDescriptor;
			if (pd != null)
			{
				var dpd = DependencyPropertyDescriptor.FromProperty(pd);
				if (dpd != null)
				{
					if (dpd.IsAttached)
					{
						prop = properties.GetAttachedProperty(dpd.DependencyProperty);
					}
					else
					{
						prop = properties.GetProperty(dpd.DependencyProperty);
					}
				}
			}

			if (prop == null)
			{
				prop = properties[md.Name];
			}

			return prop;
		}
开发者ID:hefnerliu,项目名称:SharpDevelop,代码行数:31,代码来源:ExtensionMethods.cs

示例3: ComponentChangedEventArgs

 /// <summary>
 /// <para>Initializes a new instance of the <see cref='System.ComponentModel.Design.ComponentChangedEventArgs'/> class.</para>
 /// </summary>
 public ComponentChangedEventArgs(object component, MemberDescriptor member, object oldValue, object newValue)
 {
     Component = component;
     Member = member;
     OldValue = oldValue;
     NewValue = newValue;
 }
开发者ID:chcosta,项目名称:corefx,代码行数:10,代码来源:ComponentChangedEvent.cs

示例4: ComponentChangedEventArgs

 public ComponentChangedEventArgs(object component, MemberDescriptor member, object oldValue, object newValue)
 {
     this.component = component;
     this.member = member;
     this.oldValue = oldValue;
     this.newValue = newValue;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ComponentChangedEventArgs.cs

示例5: Serialize

		public override void Serialize (IDesignerSerializationManager manager, object value, MemberDescriptor descriptor, 
						CodeStatementCollection statements)
		{
			if (statements == null)
				throw new ArgumentNullException ("statements");
			if (manager == null)
				throw new ArgumentNullException ("manager");
			if (value == null)
				throw new ArgumentNullException ("value");
			if (descriptor == null)
				throw new ArgumentNullException ("descriptor");

			IEventBindingService service = manager.GetService (typeof (IEventBindingService)) as IEventBindingService;
			if (service != null) {
				EventDescriptor eventDescriptor = (EventDescriptor) descriptor;
				string methodName = (string) service.GetEventProperty (eventDescriptor).GetValue (value);

				if (methodName != null) {
					CodeDelegateCreateExpression listener = new CodeDelegateCreateExpression (new CodeTypeReference (eventDescriptor.EventType),
																							   _thisReference, methodName);
					CodeExpression targetObject = base.SerializeToExpression (manager, value);
					CodeEventReferenceExpression eventRef = new CodeEventReferenceExpression (targetObject, eventDescriptor.Name);
					statements.Add (new CodeAttachEventStatement (eventRef, listener));
				}
			}
		}
开发者ID:Profit0004,项目名称:mono,代码行数:26,代码来源:EventCodeDomSerializer.cs

示例6: ActivityChangedEventArgs

 public ActivityChangedEventArgs(System.Workflow.ComponentModel.Activity activity, MemberDescriptor member, object oldValue, object newValue)
 {
     this.activity = activity;
     this.member = member;
     this.oldValue = oldValue;
     this.newValue = newValue;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:ActivityChangedEventArgs.cs

示例7: ShouldSerialize

		public override bool ShouldSerialize (IDesignerSerializationManager manager, object value, MemberDescriptor descriptor)
		{
			IEventBindingService service = manager.GetService (typeof (IEventBindingService)) as IEventBindingService;
			if (service != null) // serialize only if there is an event to serialize
				return service.GetEventProperty ((EventDescriptor)descriptor).GetValue (value) != null;
			return false;
		}
开发者ID:Profit0004,项目名称:mono,代码行数:7,代码来源:EventCodeDomSerializer.cs

示例8: MemberDescriptor

 protected MemberDescriptor(MemberDescriptor oldMemberDescriptor, Attribute[] newAttributes)
 {
     this.lockCookie = new object();
     this.name = oldMemberDescriptor.Name;
     this.displayName = oldMemberDescriptor.DisplayName;
     this.nameHash = this.name.GetHashCode();
     ArrayList list = new ArrayList();
     if (oldMemberDescriptor.Attributes.Count != 0)
     {
         foreach (object obj2 in oldMemberDescriptor.Attributes)
         {
             list.Add(obj2);
         }
     }
     if (newAttributes != null)
     {
         Attribute[] attributeArray = newAttributes;
         for (int i = 0; i < attributeArray.Length; i++)
         {
             object obj3 = attributeArray[i];
             list.Add(obj3);
         }
     }
     this.attributes = new Attribute[list.Count];
     list.CopyTo(this.attributes, 0);
     this.attributesFiltered = false;
     this.originalAttributes = this.attributes;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:28,代码来源:MemberDescriptor.cs

示例9: ArgumentNullException

 public MemberRelationship this[object sourceOwner, MemberDescriptor sourceMember]
 {
     get
     {
         if (sourceOwner == null)
         {
             throw new ArgumentNullException("sourceOwner");
         }
         if (sourceMember == null)
         {
             throw new ArgumentNullException("sourceMember");
         }
         return this.GetRelationship(new MemberRelationship(sourceOwner, sourceMember));
     }
     set
     {
         if (sourceOwner == null)
         {
             throw new ArgumentNullException("sourceOwner");
         }
         if (sourceMember == null)
         {
             throw new ArgumentNullException("sourceMember");
         }
         this.SetRelationship(new MemberRelationship(sourceOwner, sourceMember), value);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:MemberRelationshipService.cs

示例10: Serialize

		public override void Serialize (IDesignerSerializationManager manager, object value, MemberDescriptor descriptor, CodeStatementCollection statements)
		{
			if (statements == null)
				throw new ArgumentNullException ("statements");
			if (manager == null)
				throw new ArgumentNullException ("manager");
			if (value == null)
				throw new ArgumentNullException ("value");
			if (descriptor == null)
				throw new ArgumentNullException ("descriptor");

			IEventBindingService service = manager.GetService (typeof (IEventBindingService)) as IEventBindingService;
			if (service != null) {
				// In the propertygrid the events are represented by PropertyDescriptors and the value is a string
				// which contains the method name to bind to. The propertydescriptors are managed and created by the 
				// IEventBindingService
				// 
				EventDescriptor ev = (EventDescriptor) descriptor;
				string methodName = (string) service.GetEventProperty (ev).GetValue (value);
				CodeDelegateCreateExpression listener = new CodeDelegateCreateExpression (new CodeTypeReference (ev.EventType), _thisReference, methodName);
				CodeExpression targetObject = base.SerializeToExpression (manager, value);
				CodeEventReferenceExpression eventRef = new CodeEventReferenceExpression (targetObject, ev.Name);
				statements.Add (new CodeAttachEventStatement (eventRef, listener));
			}
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:25,代码来源:EventCodeDomSerializer.cs

示例11: ShouldSerialize

 public bool ShouldSerialize(MemberDescriptor member)
 {
     if (this._member != null)
     {
         return (this._member == member);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SerializeAbsoluteContext.cs

示例12:

	protected MemberDescriptor
				(MemberDescriptor descr, Attribute[] newAttributes)
			{
				this.name = descr.Name;
				this.displayName = descr.DisplayName;
				this.attributes =
					MergeAttributes(descr.AttributeArray, newAttributes);
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:MemberDescriptor.cs

示例13: SerializeMember

 public override void SerializeMember(SerializationStore store, object owningObject, MemberDescriptor member)
 {
     if (store == null) throw new ArgumentNullException("store");
     if (owningObject == null) throw new ArgumentNullException("owningObject");
     if (member == null) throw new ArgumentNullException("member");
     WorkflowMarkupSerializationStore xomlStore = store as WorkflowMarkupSerializationStore;
     if (xomlStore == null) throw new InvalidOperationException(SR.GetString(SR.Error_UnknownSerializationStore));
     xomlStore.AddMember(owningObject, member);
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:9,代码来源:ComponentSerializationService.cs

示例14: AddCustomAttributes

 // <summary>
 // Adds the contents of the provided attributes to this builder.
 // Conflicts are resolved with a last-in-wins strategy.
 // </summary>
 // <param name="descriptor">An event or property descriptor to add attributes to.</param>
 // <param name="attributes">
 // The new attributes to add.
 // </param>
 // <exception cref="ArgumentNullException">if descriptor or attributes is null</exception>
 public void AddCustomAttributes(MemberDescriptor descriptor, params Attribute[] attributes) {
     if (descriptor == null) 
     {
         throw FxTrace.Exception.ArgumentNull("descriptor");
     }
     if (attributes == null) 
     {
         throw FxTrace.Exception.ArgumentNull("attributes");
     }
     _table.AddCustomAttributes(_callbackType, descriptor, attributes);
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:20,代码来源:AttributeCallbackBuilder.cs

示例15: Serialize

 public override void Serialize(IDesignerSerializationManager manager, object value, MemberDescriptor descriptor, CodeStatementCollection statements)
 {
     manager.Context.Push(this._model);
     try
     {
         this._serializer.Serialize(manager, value, descriptor, statements);
     }
     finally
     {
         manager.Context.Pop();
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:12,代码来源:ResourcePropertyMemberCodeDomSerializer.cs


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