protected void SerializeEvent (IDesignerSerializationManager manager, CodeStatementCollection statements, object value, EventDescriptor descriptor) { if (descriptor == null) throw new ArgumentNullException ("descriptor"); if (value == null) throw new ArgumentNullException ("value"); if (statements == null) throw new ArgumentNullException ("statements"); if (manager == null) throw new ArgumentNullException ("manager"); MemberCodeDomSerializer serializer = manager.GetSerializer (descriptor.GetType (), typeof (MemberCodeDomSerializer)) as MemberCodeDomSerializer; if (serializer != null && serializer.ShouldSerialize (manager, value, descriptor)) serializer.Serialize (manager, value, descriptor, statements); }
protected void SerializeEvent(IDesignerSerializationManager manager, CodeStatementCollection statements, object value, EventDescriptor descriptor) { if (manager == null) { throw new ArgumentNullException("manager"); } if (statements == null) { throw new ArgumentNullException("statements"); } if (value == null) { throw new ArgumentNullException("value"); } if (descriptor == null) { throw new ArgumentNullException("descriptor"); } using (TraceScope("CodeDomSerializerBase::SerializeEvent")) { manager.Context.Push(statements); manager.Context.Push(descriptor); try { MemberCodeDomSerializer serializer = (MemberCodeDomSerializer) manager.GetSerializer(descriptor.GetType(), typeof(MemberCodeDomSerializer)); if ((serializer != null) && serializer.ShouldSerialize(manager, value, descriptor)) { serializer.Serialize(manager, value, descriptor, statements); } } finally { manager.Context.Pop(); manager.Context.Pop(); } } }