/*************************************************************************************
DocX – DocX is the community edition of Xceed Words for .NET
Copyright (C) 2009-2016 Xceed Software Inc.
This program is provided to you under the terms of the Microsoft Public
License (Ms-PL) as published at http://wpftoolkit.codeplex.com/license
For more features and fast professional support,
pick up Xceed Words for .NET at https://xceed.com/xceed-words-for-net/
***********************************************************************************/
using System;
using System.Xml.Linq;
namespace Xceed.Words.NET
{
///
/// Axis base class
///
public abstract class Axis
{
#region Public Properties
///
/// ID of this Axis
///
public String Id
{
get
{
return Xml.Element( XName.Get( "axId", DocX.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value;
}
}
///
/// Return true if this axis is visible
///
public Boolean IsVisible
{
get
{
return Xml.Element( XName.Get( "delete", DocX.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value == "0";
}
set
{
if( value )
Xml.Element( XName.Get( "delete", DocX.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value = "0";
else
Xml.Element( XName.Get( "delete", DocX.c.NamespaceName ) ).Attribute( XName.Get( "val" ) ).Value = "1";
}
}
#endregion
#region Internal Properties
///
/// Axis xml element
///
internal XElement Xml
{
get; set;
}
#endregion
#region Constructors
internal Axis( XElement xml )
{
Xml = xml;
}
public Axis( String id )
{
}
#endregion
}
///
/// Represents Category Axes
///
public class CategoryAxis : Axis
{
internal CategoryAxis( XElement xml )
: base( xml )
{
}
public CategoryAxis( String id )
: base( id )
{
Xml = XElement.Parse( String.Format(
@"
", id ) );
}
}
///
/// Represents Values Axes
///
public class ValueAxis : Axis
{
internal ValueAxis( XElement xml )
: base( xml )
{
}
public ValueAxis( String id )
: base( id )
{
Xml = XElement.Parse( String.Format(
@"
", id ) );
}
}
}