#region Disclaimer / License
// Copyright (C) 2010, Jackie Ng
// http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using OSGeo.MapGuide.MaestroAPI.Resource;
using OSGeo.MapGuide.MaestroAPI;
#pragma warning disable 1591, 0114, 0108
namespace OSGeo.MapGuide.ObjectModels
{
///
/// Represents resource content that could not be deserialized into a corresponding
/// strongly-typed resource class. This is just a container of arbitrary xml content.
///
public class UntypedResource : IResource
{
internal UntypedResource(string xml, ResourceTypes resourceType, string version)
{
this.XmlContent = xml;
this.ResourceType = resourceType;
this.ResourceVersion = new Version(version);
}
internal UntypedResource(string xml, ResourceTypes resourceType, Version version)
{
this.XmlContent = xml;
this.ResourceType = resourceType;
this.ResourceVersion = version;
}
///
/// Gets or sets the current connection.
///
/// The current connection.
public IServerConnection CurrentConnection
{
get;
set;
}
///
/// Gets the validating XML schema
///
public string ValidatingSchema
{
get { return this.ResourceType + "-" + this.ResourceVersion.ToString() + ".xsd"; }
}
///
/// Gets or sets the resource id
///
public string ResourceID
{
get;
set;
}
///
/// Gets the resource type
///
public ResourceTypes ResourceType
{
get;
private set;
}
///
/// Gets or sets the XML content
///
public string XmlContent
{
get;
set;
}
///
/// Gets the XML form of this instance
///
///
public string Serialize()
{
return this.XmlContent;
}
///
/// Gets the resource version
///
public Version ResourceVersion
{
get;
private set;
}
///
/// Returns a clone of this instance
///
///
public object Clone()
{
return this.MemberwiseClone();
}
///
/// Raised when a property changes
///
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
///
/// Gets whether this resource is strongly typed
///
public bool IsStronglyTyped
{
get { return false; }
}
}
}