Dev2.Runtime.ServiceModel.Data.PluginSource.ToXml C# (CSharp) Method

ToXml() public method

public ToXml ( ) : System.Xml.Linq.XElement
return System.Xml.Linq.XElement
        public override XElement ToXml()
        {
            var result = base.ToXml();
            result.Add(
                new XAttribute("AssemblyLocation", AssemblyLocation ?? string.Empty),
                new XAttribute("AssemblyName", AssemblyName ?? string.Empty),
                new XAttribute("Type", enSourceType.Plugin),
                new XElement("TypeOf", enSourceType.Plugin)
                );
            return result;
        }

Usage Example

Example #1
0
        public void PluginSourceToXmlWithNullPropertiesExpectedSerializesPropertiesAsEmpty()
        {
            var expected = new PluginSource
            {
                AssemblyLocation = null,
                AssemblyName = null,
            };

            var xml = expected.ToXml();

            var actual = new PluginSource(xml);

            Assert.AreEqual(expected.ResourceType, actual.ResourceType);
            Assert.AreEqual("", actual.AssemblyLocation);
            Assert.AreEqual("", actual.AssemblyName);
        }
All Usage Examples Of Dev2.Runtime.ServiceModel.Data.PluginSource::ToXml