本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: ComponentChangedEventArgs
public ComponentChangedEventArgs(object component, MemberDescriptor member, object oldValue, object newValue)
{
this.component = component;
this.member = member;
this.oldValue = oldValue;
this.newValue = newValue;
}
示例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));
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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));
}
}
示例11: ShouldSerialize
public bool ShouldSerialize(MemberDescriptor member)
{
if (this._member != null)
{
return (this._member == member);
}
return true;
}
示例12:
protected MemberDescriptor
(MemberDescriptor descr, Attribute[] newAttributes)
{
this.name = descr.Name;
this.displayName = descr.DisplayName;
this.attributes =
MergeAttributes(descr.AttributeArray, newAttributes);
}
示例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);
}
示例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);
}
示例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