#pragma warning disable 1591, 0114, 0108
// ------------------------------------------------------------------------------
//
// Generated by Xsd2Code. Version 3.3.0.33001
// OSGeo.MapGuide.ObjectModels.MapDefinitionBindingListCSharpTrueFalseTrueTrueTrueFalseTrueFalseNet20SerializeDeserializeSaveToFileLoadFromFileTrueFalseFalseFalseFalse
//
// ------------------------------------------------------------------------------
namespace OSGeo.MapGuide.ObjectModels.MapDefinition.v2_3_0
{
using OSGeo.MapGuide.ObjectModels.WatermarkDefinition.v2_3_0;
using System.ComponentModel;
using System.Drawing;
using System.IO;
///
/// A MapDefinition defines the collection of layers, groupings of layers, and base map
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
public partial class MapDefinition : MapDefinitionType, System.ComponentModel.INotifyPropertyChanged {
private static System.Xml.Serialization.XmlSerializer serializer;
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapDefinition));
}
return serializer;
}
}
[EditorBrowsable(EditorBrowsableState.Never)]
private string versionField;
[System.Xml.Serialization.XmlAttributeAttribute()]
public string version
{
get
{
return this.versionField;
}
set
{
if ((this.versionField != null))
{
if ((versionField.Equals(value) != true))
{
this.versionField = value;
this.OnPropertyChanged("version");
}
}
else
{
this.versionField = value;
this.OnPropertyChanged("version");
}
}
}
#region Serialize/Deserialize
///
/// Serializes current MapDefinition object into an XML document
///
/// string XML value
public virtual string Serialize() {
return base.NormalizedSerialize(Serializer, this);
}
///
/// Deserializes workflow markup into an MapDefinition object
///
/// string workflow markup to deserialize
/// Output MapDefinition object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out MapDefinition obj, out System.Exception exception) {
exception = null;
obj = default(MapDefinition);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out MapDefinition obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static MapDefinition Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((MapDefinition)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current MapDefinition object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an MapDefinition object
///
/// string xml file to load and deserialize
/// Output MapDefinition object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out MapDefinition obj, out System.Exception exception) {
exception = null;
obj = default(MapDefinition);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out MapDefinition obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static MapDefinition LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this MapDefinition object
///
public virtual MapDefinition Clone() {
return ((MapDefinition)(this.MemberwiseClone()));
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class MapDefinitionType : BaseSerializableMapDefinition, System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private string nameField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string coordinateSystemField;
[EditorBrowsable(EditorBrowsableState.Never)]
private Box2DType extentsField;
[EditorBrowsable(EditorBrowsableState.Never)]
private Color backgroundColorField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string metadataField;
[EditorBrowsable(EditorBrowsableState.Never)]
private BindingList mapLayerField;
[EditorBrowsable(EditorBrowsableState.Never)]
private BindingList mapLayerGroupField;
[EditorBrowsable(EditorBrowsableState.Never)]
private MapDefinitionTypeBaseMapDefinition baseMapDefinitionField;
[EditorBrowsable(EditorBrowsableState.Never)]
private BindingList watermarksField;
private static System.Xml.Serialization.XmlSerializer serializer;
public string Name {
get {
return this.nameField;
}
set {
if ((this.nameField != null)) {
if ((nameField.Equals(value) != true)) {
this.nameField = value;
this.OnPropertyChanged("Name");
}
}
else {
this.nameField = value;
this.OnPropertyChanged("Name");
}
}
}
public string CoordinateSystem {
get {
return this.coordinateSystemField;
}
set {
if ((this.coordinateSystemField != null)) {
if ((coordinateSystemField.Equals(value) != true)) {
this.coordinateSystemField = value;
this.OnPropertyChanged("CoordinateSystem");
}
}
else {
this.coordinateSystemField = value;
this.OnPropertyChanged("CoordinateSystem");
}
}
}
public Box2DType Extents {
get {
return this.extentsField;
}
set {
if ((this.extentsField != null)) {
if ((extentsField.Equals(value) != true)) {
this.extentsField = value;
this.OnPropertyChanged("Extents");
}
}
else {
this.extentsField = value;
this.OnPropertyChanged("Extents");
}
}
}
[System.Xml.Serialization.XmlElementAttribute("BackgroundColor")]
public string BackgroundColorAsHtml {
get {
return base.SerializeHTMLColor(this.backgroundColorField, true);
}
set {
var c = base.ParseHTMLColor(value);
if ((this.backgroundColorField != null)) {
if ((backgroundColorField.Equals(c) != true)) {
this.backgroundColorField = c;
this.OnPropertyChanged("BackgroundColor");
}
}
else {
this.backgroundColorField = c;
this.OnPropertyChanged("BackgroundColor");
}
}
}
public string Metadata {
get {
return this.metadataField;
}
set {
if ((this.metadataField != null)) {
if ((metadataField.Equals(value) != true)) {
this.metadataField = value;
this.OnPropertyChanged("Metadata");
}
}
else {
this.metadataField = value;
this.OnPropertyChanged("Metadata");
}
}
}
[System.Xml.Serialization.XmlElementAttribute("MapLayer")]
public BindingList MapLayer {
get {
return this.mapLayerField;
}
set {
if ((this.mapLayerField != null)) {
if ((mapLayerField.Equals(value) != true)) {
this.mapLayerField = value;
this.OnPropertyChanged("MapLayer");
}
}
else {
this.mapLayerField = value;
this.OnPropertyChanged("MapLayer");
}
}
}
[System.Xml.Serialization.XmlElementAttribute("MapLayerGroup")]
public BindingList MapLayerGroup {
get {
return this.mapLayerGroupField;
}
set {
if ((this.mapLayerGroupField != null)) {
if ((mapLayerGroupField.Equals(value) != true)) {
this.mapLayerGroupField = value;
this.OnPropertyChanged("MapLayerGroup");
}
}
else {
this.mapLayerGroupField = value;
this.OnPropertyChanged("MapLayerGroup");
}
}
}
public MapDefinitionTypeBaseMapDefinition BaseMapDefinition {
get {
return this.baseMapDefinitionField;
}
set {
if ((this.baseMapDefinitionField != null)) {
if ((baseMapDefinitionField.Equals(value) != true)) {
this.baseMapDefinitionField = value;
this.OnPropertyChanged("BaseMapDefinition");
}
}
else {
this.baseMapDefinitionField = value;
this.OnPropertyChanged("BaseMapDefinition");
}
}
}
[System.Xml.Serialization.XmlArrayItemAttribute("Watermark", IsNullable = false)]
public BindingList Watermarks
{
get
{
return this.watermarksField;
}
set
{
if ((this.watermarksField != null))
{
if ((watermarksField.Equals(value) != true))
{
this.watermarksField = value;
this.OnPropertyChanged("Watermarks");
}
}
else
{
this.watermarksField = value;
this.OnPropertyChanged("Watermarks");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapDefinitionType));
}
return serializer;
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string info) {
System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
if ((handler != null)) {
handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
}
}
#region Serialize/Deserialize
///
/// Serializes current MapDefinitionType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an MapDefinitionType object
///
/// string workflow markup to deserialize
/// Output MapDefinitionType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out MapDefinitionType obj, out System.Exception exception) {
exception = null;
obj = default(MapDefinitionType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out MapDefinitionType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static MapDefinitionType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((MapDefinitionType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current MapDefinitionType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an MapDefinitionType object
///
/// string xml file to load and deserialize
/// Output MapDefinitionType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out MapDefinitionType obj, out System.Exception exception) {
exception = null;
obj = default(MapDefinitionType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out MapDefinitionType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static MapDefinitionType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this MapDefinitionType object
///
public virtual MapDefinitionType Clone() {
return ((MapDefinitionType)(this.MemberwiseClone()));
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class Box2DType : System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private double minXField;
[EditorBrowsable(EditorBrowsableState.Never)]
private double maxXField;
[EditorBrowsable(EditorBrowsableState.Never)]
private double minYField;
[EditorBrowsable(EditorBrowsableState.Never)]
private double maxYField;
private static System.Xml.Serialization.XmlSerializer serializer;
public double MinX {
get {
return this.minXField;
}
set {
if ((minXField.Equals(value) != true)) {
this.minXField = value;
this.OnPropertyChanged("MinX");
}
}
}
public double MaxX {
get {
return this.maxXField;
}
set {
if ((maxXField.Equals(value) != true)) {
this.maxXField = value;
this.OnPropertyChanged("MaxX");
}
}
}
public double MinY {
get {
return this.minYField;
}
set {
if ((minYField.Equals(value) != true)) {
this.minYField = value;
this.OnPropertyChanged("MinY");
}
}
}
public double MaxY {
get {
return this.maxYField;
}
set {
if ((maxYField.Equals(value) != true)) {
this.maxYField = value;
this.OnPropertyChanged("MaxY");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(Box2DType));
}
return serializer;
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string info) {
System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
if ((handler != null)) {
handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
}
}
#region Serialize/Deserialize
///
/// Serializes current Box2DType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an Box2DType object
///
/// string workflow markup to deserialize
/// Output Box2DType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out Box2DType obj, out System.Exception exception) {
exception = null;
obj = default(Box2DType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out Box2DType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static Box2DType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((Box2DType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current Box2DType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an Box2DType object
///
/// string xml file to load and deserialize
/// Output Box2DType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out Box2DType obj, out System.Exception exception) {
exception = null;
obj = default(Box2DType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out Box2DType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static Box2DType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this Box2DType object
///
public virtual Box2DType Clone() {
return ((Box2DType)(this.MemberwiseClone()));
}
#endregion
}
[System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseMapLayerGroupCommonType))]
[System.Xml.Serialization.XmlIncludeAttribute(typeof(MapLayerGroupType))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class MapLayerGroupCommonType : System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private string nameField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool visibleField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool showInLegendField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool expandInLegendField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string legendLabelField;
private static System.Xml.Serialization.XmlSerializer serializer;
public string Name {
get {
return this.nameField;
}
set {
if ((this.nameField != null)) {
if ((nameField.Equals(value) != true)) {
this.nameField = value;
this.OnPropertyChanged("Name");
}
}
else {
this.nameField = value;
this.OnPropertyChanged("Name");
}
}
}
public bool Visible {
get {
return this.visibleField;
}
set {
if ((visibleField.Equals(value) != true)) {
this.visibleField = value;
this.OnPropertyChanged("Visible");
}
}
}
public bool ShowInLegend {
get {
return this.showInLegendField;
}
set {
if ((showInLegendField.Equals(value) != true)) {
this.showInLegendField = value;
this.OnPropertyChanged("ShowInLegend");
}
}
}
public bool ExpandInLegend {
get {
return this.expandInLegendField;
}
set {
if ((expandInLegendField.Equals(value) != true)) {
this.expandInLegendField = value;
this.OnPropertyChanged("ExpandInLegend");
}
}
}
public string LegendLabel {
get {
return this.legendLabelField;
}
set {
if ((this.legendLabelField != null)) {
if ((legendLabelField.Equals(value) != true)) {
this.legendLabelField = value;
this.OnPropertyChanged("LegendLabel");
}
}
else {
this.legendLabelField = value;
this.OnPropertyChanged("LegendLabel");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapLayerGroupCommonType));
}
return serializer;
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string info) {
System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
if ((handler != null)) {
handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
}
}
#region Serialize/Deserialize
///
/// Serializes current MapLayerGroupCommonType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an MapLayerGroupCommonType object
///
/// string workflow markup to deserialize
/// Output MapLayerGroupCommonType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out MapLayerGroupCommonType obj, out System.Exception exception) {
exception = null;
obj = default(MapLayerGroupCommonType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out MapLayerGroupCommonType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static MapLayerGroupCommonType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((MapLayerGroupCommonType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current MapLayerGroupCommonType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an MapLayerGroupCommonType object
///
/// string xml file to load and deserialize
/// Output MapLayerGroupCommonType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out MapLayerGroupCommonType obj, out System.Exception exception) {
exception = null;
obj = default(MapLayerGroupCommonType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out MapLayerGroupCommonType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static MapLayerGroupCommonType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this MapLayerGroupCommonType object
///
public virtual MapLayerGroupCommonType Clone() {
return ((MapLayerGroupCommonType)(this.MemberwiseClone()));
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class BaseMapLayerGroupCommonType : MapLayerGroupCommonType, System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private BindingList baseMapLayerField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("BaseMapLayer")]
public BindingList BaseMapLayer {
get {
return this.baseMapLayerField;
}
set {
if ((this.baseMapLayerField != null)) {
if ((baseMapLayerField.Equals(value) != true)) {
this.baseMapLayerField = value;
this.OnPropertyChanged("BaseMapLayer");
}
}
else {
this.baseMapLayerField = value;
this.OnPropertyChanged("BaseMapLayer");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(BaseMapLayerGroupCommonType));
}
return serializer;
}
}
//public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
//public virtual void OnPropertyChanged(string info) {
// System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
// if ((handler != null)) {
// handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
// }
//}
#region Serialize/Deserialize
///
/// Serializes current BaseMapLayerGroupCommonType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an BaseMapLayerGroupCommonType object
///
/// string workflow markup to deserialize
/// Output BaseMapLayerGroupCommonType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out BaseMapLayerGroupCommonType obj, out System.Exception exception) {
exception = null;
obj = default(BaseMapLayerGroupCommonType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out BaseMapLayerGroupCommonType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static BaseMapLayerGroupCommonType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((BaseMapLayerGroupCommonType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current BaseMapLayerGroupCommonType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an BaseMapLayerGroupCommonType object
///
/// string xml file to load and deserialize
/// Output BaseMapLayerGroupCommonType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out BaseMapLayerGroupCommonType obj, out System.Exception exception) {
exception = null;
obj = default(BaseMapLayerGroupCommonType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out BaseMapLayerGroupCommonType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static BaseMapLayerGroupCommonType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this BaseMapLayerGroupCommonType object
///
public virtual BaseMapLayerGroupCommonType Clone() {
return ((BaseMapLayerGroupCommonType)(this.MemberwiseClone()));
}
#endregion
}
[System.Xml.Serialization.XmlIncludeAttribute(typeof(MapLayerType))]
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class BaseMapLayerType : System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private string nameField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string resourceIdField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool selectableField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool showInLegendField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string legendLabelField;
[EditorBrowsable(EditorBrowsableState.Never)]
private bool expandInLegendField;
private static System.Xml.Serialization.XmlSerializer serializer;
public string Name {
get {
return this.nameField;
}
set {
if ((this.nameField != null)) {
if ((nameField.Equals(value) != true)) {
this.nameField = value;
this.OnPropertyChanged("Name");
}
}
else {
this.nameField = value;
this.OnPropertyChanged("Name");
}
}
}
public string ResourceId {
get {
return this.resourceIdField;
}
set {
if ((this.resourceIdField != null)) {
if ((resourceIdField.Equals(value) != true)) {
this.resourceIdField = value;
this.OnPropertyChanged("ResourceId");
}
}
else {
this.resourceIdField = value;
this.OnPropertyChanged("ResourceId");
}
}
}
public bool Selectable {
get {
return this.selectableField;
}
set {
if ((selectableField.Equals(value) != true)) {
this.selectableField = value;
this.OnPropertyChanged("Selectable");
}
}
}
public bool ShowInLegend {
get {
return this.showInLegendField;
}
set {
if ((showInLegendField.Equals(value) != true)) {
this.showInLegendField = value;
this.OnPropertyChanged("ShowInLegend");
}
}
}
public string LegendLabel {
get {
return this.legendLabelField;
}
set {
if ((this.legendLabelField != null)) {
if ((legendLabelField.Equals(value) != true)) {
this.legendLabelField = value;
this.OnPropertyChanged("LegendLabel");
}
}
else {
this.legendLabelField = value;
this.OnPropertyChanged("LegendLabel");
}
}
}
public bool ExpandInLegend {
get {
return this.expandInLegendField;
}
set {
if ((expandInLegendField.Equals(value) != true)) {
this.expandInLegendField = value;
this.OnPropertyChanged("ExpandInLegend");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(BaseMapLayerType));
}
return serializer;
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string info) {
System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
if ((handler != null)) {
handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
}
}
#region Serialize/Deserialize
///
/// Serializes current BaseMapLayerType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an BaseMapLayerType object
///
/// string workflow markup to deserialize
/// Output BaseMapLayerType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out BaseMapLayerType obj, out System.Exception exception) {
exception = null;
obj = default(BaseMapLayerType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out BaseMapLayerType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static BaseMapLayerType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((BaseMapLayerType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current BaseMapLayerType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an BaseMapLayerType object
///
/// string xml file to load and deserialize
/// Output BaseMapLayerType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out BaseMapLayerType obj, out System.Exception exception) {
exception = null;
obj = default(BaseMapLayerType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out BaseMapLayerType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static BaseMapLayerType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this BaseMapLayerType object
///
public virtual BaseMapLayerType Clone() {
return ((BaseMapLayerType)(this.MemberwiseClone()));
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class MapLayerType : BaseMapLayerType, System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private bool visibleField;
[EditorBrowsable(EditorBrowsableState.Never)]
private string groupField;
private static System.Xml.Serialization.XmlSerializer serializer;
public bool Visible {
get {
return this.visibleField;
}
set {
if ((visibleField.Equals(value) != true)) {
this.visibleField = value;
this.OnPropertyChanged("Visible");
}
}
}
public string Group {
get {
return this.groupField;
}
set {
if ((this.groupField != null)) {
if ((groupField.Equals(value) != true)) {
this.groupField = value;
this.OnPropertyChanged("Group");
}
}
else {
this.groupField = value;
this.OnPropertyChanged("Group");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapLayerType));
}
return serializer;
}
}
//public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
//public virtual void OnPropertyChanged(string info) {
// System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
// if ((handler != null)) {
// handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
// }
//}
#region Serialize/Deserialize
///
/// Serializes current MapLayerType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an MapLayerType object
///
/// string workflow markup to deserialize
/// Output MapLayerType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out MapLayerType obj, out System.Exception exception) {
exception = null;
obj = default(MapLayerType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out MapLayerType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static MapLayerType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((MapLayerType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current MapLayerType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an MapLayerType object
///
/// string xml file to load and deserialize
/// Output MapLayerType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out MapLayerType obj, out System.Exception exception) {
exception = null;
obj = default(MapLayerType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out MapLayerType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static MapLayerType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this MapLayerType object
///
public virtual MapLayerType Clone() {
return ((MapLayerType)(this.MemberwiseClone()));
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=true)]
public partial class MapLayerGroupType : MapLayerGroupCommonType, System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private string groupField;
private static System.Xml.Serialization.XmlSerializer serializer;
public string Group {
get {
return this.groupField;
}
set {
if ((this.groupField != null)) {
if ((groupField.Equals(value) != true)) {
this.groupField = value;
this.OnPropertyChanged("Group");
}
}
else {
this.groupField = value;
this.OnPropertyChanged("Group");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapLayerGroupType));
}
return serializer;
}
}
//public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
//public virtual void OnPropertyChanged(string info) {
// System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
// if ((handler != null)) {
// handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
// }
//}
#region Serialize/Deserialize
///
/// Serializes current MapLayerGroupType object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an MapLayerGroupType object
///
/// string workflow markup to deserialize
/// Output MapLayerGroupType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out MapLayerGroupType obj, out System.Exception exception) {
exception = null;
obj = default(MapLayerGroupType);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out MapLayerGroupType obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static MapLayerGroupType Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((MapLayerGroupType)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current MapLayerGroupType object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an MapLayerGroupType object
///
/// string xml file to load and deserialize
/// Output MapLayerGroupType object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out MapLayerGroupType obj, out System.Exception exception) {
exception = null;
obj = default(MapLayerGroupType);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out MapLayerGroupType obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static MapLayerGroupType LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this MapLayerGroupType object
///
public virtual MapLayerGroupType Clone() {
return ((MapLayerGroupType)(this.MemberwiseClone()));
}
#endregion
}
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(AnonymousType=true)]
public partial class MapDefinitionTypeBaseMapDefinition : System.ComponentModel.INotifyPropertyChanged {
[EditorBrowsable(EditorBrowsableState.Never)]
private BindingList finiteDisplayScaleField;
[EditorBrowsable(EditorBrowsableState.Never)]
private BindingList baseMapLayerGroupField;
private static System.Xml.Serialization.XmlSerializer serializer;
[System.Xml.Serialization.XmlElementAttribute("FiniteDisplayScale")]
public BindingList FiniteDisplayScale {
get {
return this.finiteDisplayScaleField;
}
set {
if ((this.finiteDisplayScaleField != null)) {
if ((finiteDisplayScaleField.Equals(value) != true)) {
this.finiteDisplayScaleField = value;
this.OnPropertyChanged("FiniteDisplayScale");
}
}
else {
this.finiteDisplayScaleField = value;
this.OnPropertyChanged("FiniteDisplayScale");
}
}
}
[System.Xml.Serialization.XmlElementAttribute("BaseMapLayerGroup")]
public BindingList BaseMapLayerGroup {
get {
return this.baseMapLayerGroupField;
}
set {
if ((this.baseMapLayerGroupField != null)) {
if ((baseMapLayerGroupField.Equals(value) != true)) {
this.baseMapLayerGroupField = value;
this.OnPropertyChanged("BaseMapLayerGroup");
}
}
else {
this.baseMapLayerGroupField = value;
this.OnPropertyChanged("BaseMapLayerGroup");
}
}
}
private static System.Xml.Serialization.XmlSerializer Serializer {
get {
if ((serializer == null)) {
serializer = new System.Xml.Serialization.XmlSerializer(typeof(MapDefinitionTypeBaseMapDefinition));
}
return serializer;
}
}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
public virtual void OnPropertyChanged(string info) {
System.ComponentModel.PropertyChangedEventHandler handler = this.PropertyChanged;
if ((handler != null)) {
handler(this, new System.ComponentModel.PropertyChangedEventArgs(info));
}
}
#region Serialize/Deserialize
///
/// Serializes current MapDefinitionTypeBaseMapDefinition object into an XML document
///
/// string XML value
public virtual string Serialize() {
System.IO.StreamReader streamReader = null;
System.IO.MemoryStream memoryStream = null;
try {
memoryStream = new System.IO.MemoryStream();
Serializer.Serialize(memoryStream, this);
memoryStream.Seek(0, System.IO.SeekOrigin.Begin);
streamReader = new System.IO.StreamReader(memoryStream);
return streamReader.ReadToEnd();
}
finally {
if ((streamReader != null)) {
streamReader.Dispose();
}
if ((memoryStream != null)) {
memoryStream.Dispose();
}
}
}
///
/// Deserializes workflow markup into an MapDefinitionTypeBaseMapDefinition object
///
/// string workflow markup to deserialize
/// Output MapDefinitionTypeBaseMapDefinition object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool Deserialize(string xml, out MapDefinitionTypeBaseMapDefinition obj, out System.Exception exception) {
exception = null;
obj = default(MapDefinitionTypeBaseMapDefinition);
try {
obj = Deserialize(xml);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool Deserialize(string xml, out MapDefinitionTypeBaseMapDefinition obj) {
System.Exception exception = null;
return Deserialize(xml, out obj, out exception);
}
public static MapDefinitionTypeBaseMapDefinition Deserialize(string xml) {
System.IO.StringReader stringReader = null;
try {
stringReader = new System.IO.StringReader(xml);
return ((MapDefinitionTypeBaseMapDefinition)(Serializer.Deserialize(System.Xml.XmlReader.Create(stringReader))));
}
finally {
if ((stringReader != null)) {
stringReader.Dispose();
}
}
}
///
/// Serializes current MapDefinitionTypeBaseMapDefinition object into file
///
/// full path of outupt xml file
/// output Exception value if failed
/// true if can serialize and save into file; otherwise, false
public virtual bool SaveToFile(string fileName, out System.Exception exception) {
exception = null;
try {
SaveToFile(fileName);
return true;
}
catch (System.Exception e) {
exception = e;
return false;
}
}
public virtual void SaveToFile(string fileName) {
System.IO.StreamWriter streamWriter = null;
try {
string xmlString = Serialize();
System.IO.FileInfo xmlFile = new System.IO.FileInfo(fileName);
streamWriter = xmlFile.CreateText();
streamWriter.WriteLine(xmlString);
streamWriter.Close();
}
finally {
if ((streamWriter != null)) {
streamWriter.Dispose();
}
}
}
///
/// Deserializes xml markup from file into an MapDefinitionTypeBaseMapDefinition object
///
/// string xml file to load and deserialize
/// Output MapDefinitionTypeBaseMapDefinition object
/// output Exception value if deserialize failed
/// true if this XmlSerializer can deserialize the object; otherwise, false
public static bool LoadFromFile(string fileName, out MapDefinitionTypeBaseMapDefinition obj, out System.Exception exception) {
exception = null;
obj = default(MapDefinitionTypeBaseMapDefinition);
try {
obj = LoadFromFile(fileName);
return true;
}
catch (System.Exception ex) {
exception = ex;
return false;
}
}
public static bool LoadFromFile(string fileName, out MapDefinitionTypeBaseMapDefinition obj) {
System.Exception exception = null;
return LoadFromFile(fileName, out obj, out exception);
}
public static MapDefinitionTypeBaseMapDefinition LoadFromFile(string fileName) {
System.IO.FileStream file = null;
System.IO.StreamReader sr = null;
try {
file = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read);
sr = new System.IO.StreamReader(file);
string xmlString = sr.ReadToEnd();
sr.Close();
file.Close();
return Deserialize(xmlString);
}
finally {
if ((file != null)) {
file.Dispose();
}
if ((sr != null)) {
sr.Dispose();
}
}
}
#endregion
#region Clone method
///
/// Create a clone of this MapDefinitionTypeBaseMapDefinition object
///
public virtual MapDefinitionTypeBaseMapDefinition Clone() {
return ((MapDefinitionTypeBaseMapDefinition)(this.MemberwiseClone()));
}
#endregion
}
}