Appccelerate.DistributedEventBroker.Serializer.XmlEventArgsSerializer.Serialize C# (CSharp) Method

Serialize() public method

Serializes the specified event argument into a string representation.
public Serialize ( EventArgs eventArgs ) : string
eventArgs System.EventArgs The instance containing the event data.
return string
        public string Serialize(EventArgs eventArgs)
        {
            Ensure.ArgumentNotNull(eventArgs, "eventArgs");

            using (var sw = new StringWriter(CultureInfo.InvariantCulture))
            {
                var serializer = new XmlSerializer(eventArgs.GetType());
                serializer.Serialize(sw, eventArgs);
                return sw.ToString();
            }
        }
XmlEventArgsSerializer