Skip to content

Commit

Permalink
V2.0.0 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
XceedBoucherS committed Dec 2, 2021
1 parent abef293 commit cb7170a
Show file tree
Hide file tree
Showing 108 changed files with 2,489 additions and 358 deletions.
2 changes: 1 addition & 1 deletion Xceed.Document.NET/AssemblyVersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
internal static class _XceedVersionInfo
{
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string BaseVersion = "1.8";
public const string BaseVersion = "2.0";
[System.Diagnostics.CodeAnalysis.SuppressMessage( "Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields" )]
public const string Version = BaseVersion +
".0.0";
Expand Down
20 changes: 18 additions & 2 deletions Xceed.Document.NET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle( "Xceed Document for .NET" )]
[assembly: AssemblyDescription( "This assembly implements the classes for Xceed Document for .NET Standard." )]
[assembly: AssemblyDescription( "This assembly implements the classes for Xceed Document for .NET." )]

[assembly: AssemblyCompany( "Xceed Software Inc." )]
[assembly: AssemblyProduct( "Xceed Document for .NET Standard" )]
[assembly: AssemblyProduct( "Xceed Document for .NET" )]
[assembly: AssemblyCopyright( "Copyright (C) Xceed Software Inc. 2009-2021" )]
[assembly: AssemblyCulture("")]

Expand All @@ -52,6 +52,13 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
"131b925dcf84a73d22264352eca7c3fcf9387f3eee1d60ac7974f04866e6c72928dc0609abe341" +
"f92cbfb5")]

[assembly: InternalsVisibleTo( "Xceed.Words.NET5" + ",PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100d59d8147eb2015" +
"ca98a92da860fd766d101271d8c2f545894870fd6183255737d79347bbf5250291ae75651e1150" +
"1b7452ee003b80b936614cdda51db8eb6f8fde913e67d45395b480a992be17bf04744a7fe803ea" +
"131b925dcf84a73d22264352eca7c3fcf9387f3eee1d60ac7974f04866e6c72928dc0609abe341" +
"f92cbfb5")]

[assembly: InternalsVisibleTo( "Xceed.PdfCreator.NET" + ",PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100d59d8147eb2015" +
"ca98a92da860fd766d101271d8c2f545894870fd6183255737d79347bbf5250291ae75651e1150" +
Expand All @@ -66,6 +73,13 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at
"131b925dcf84a73d22264352eca7c3fcf9387f3eee1d60ac7974f04866e6c72928dc0609abe341" +
"f92cbfb5")]

[assembly: InternalsVisibleTo( "Xceed.PdfCreator.NET5" + ",PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100d59d8147eb2015" +
"ca98a92da860fd766d101271d8c2f545894870fd6183255737d79347bbf5250291ae75651e1150" +
"1b7452ee003b80b936614cdda51db8eb6f8fde913e67d45395b480a992be17bf04744a7fe803ea" +
"131b925dcf84a73d22264352eca7c3fcf9387f3eee1d60ac7974f04866e6c72928dc0609abe341" +
"f92cbfb5")]

[assembly: InternalsVisibleTo( "UnitTests" + ",PublicKey=" +
"0024000004800000940000000602000000240000525341310004000001000100d59d8147eb2015" +
"ca98a92da860fd766d101271d8c2f545894870fd6183255737d79347bbf5250291ae75651e1150" +
Expand All @@ -79,6 +93,8 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at





#pragma warning disable 1699
[assembly: AssemblyDelaySign( false )]
[assembly: AssemblyKeyFile( @"..\..\sn.snk" )]
Expand Down
Binary file added Xceed.Document.NET/Resources/SignatureLine.emf
Binary file not shown.
Binary file modified Xceed.Document.NET/Resources/default_styles.xml.gz
Binary file not shown.
1 change: 1 addition & 0 deletions Xceed.Document.NET/Src/Bookmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public string Name
{
get; set;
}

public Paragraph Paragraph
{
get; set;
Expand Down
34 changes: 31 additions & 3 deletions Xceed.Document.NET/Src/Charts/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ COMMUNITY LICENSE AGREEMENT (for non-commercial use) as published at


using System;
using System.ComponentModel;
using System.Linq;
using System.Xml;
using System.Xml.Linq;

namespace Xceed.Document.NET
Expand All @@ -25,12 +28,19 @@ namespace Xceed.Document.NET
/// </summary>
public abstract class Axis
{

#region Private properties


#endregion


#region Public Properties

/// <summary>
/// ID of this Axis
/// </summary>
public String Id
public string Id
{
get
{
Expand All @@ -41,7 +51,7 @@ public String Id
/// <summary>
/// Return true if this axis is visible
/// </summary>
public Boolean IsVisible
public bool IsVisible
{
get
{
Expand All @@ -60,7 +70,25 @@ public Boolean IsVisible



#endregion





#endregion














#region Internal Properties

Expand Down
67 changes: 52 additions & 15 deletions Xceed.Document.NET/Src/Charts/Chart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public abstract class Chart
{
#region Private Members

private Paragraph _parentParagraph;
private PackageRelationship _packageRelationship;


#endregion

Expand All @@ -54,13 +57,10 @@ public List<Series> Series
get
{
var series = new List<Series>();
var ser = XName.Get( "ser", Document.c.NamespaceName );
int index = 1;
foreach( var element in ChartXml.Elements( ser ) )
var ser = ChartXml.Elements( XName.Get( "ser", Document.c.NamespaceName ) );
foreach( var element in ser )
{
element.Add( new XElement( XName.Get( "idx", Document.c.NamespaceName ) ), index.ToString() );
series.Add( new Series( element ) );
++index;
}
return series;
}
Expand Down Expand Up @@ -91,15 +91,25 @@ public ChartLegend Legend
/// </summary>
public CategoryAxis CategoryAxis
{
get; private set;
get
{
var catAxXML = ChartRootXml.Descendants( XName.Get( "catAx", Document.c.NamespaceName ) ).SingleOrDefault();

return ( catAxXML != null ) ? new CategoryAxis( catAxXML ) : null;
}
}

/// <summary>
/// Represents the values axis
/// </summary>
public ValueAxis ValueAxis
{
get; private set;
get
{
var valAxXML = ChartRootXml.Descendants( XName.Get( "valAx", Document.c.NamespaceName ) ).SingleOrDefault();

return ( valAxXML != null ) ? new ValueAxis( valAxXML ) : null;
}
}

/// <summary>
Expand Down Expand Up @@ -220,11 +230,11 @@ public Chart()
// if axes exists, create their
if( this.IsAxisExist )
{
this.CategoryAxis = new CategoryAxis( "148921728" );
this.ValueAxis = new ValueAxis( "154227840" );
var categoryAxis = new CategoryAxis( "148921728" );
var valueAxis = new ValueAxis( "154227840" );

var axIDcatXml = XElement.Parse( String.Format( @"<c:axId val=""{0}"" xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart""/>", this.CategoryAxis.Id ) );
var axIDvalXml = XElement.Parse( String.Format( @"<c:axId val=""{0}"" xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart""/>", this.ValueAxis.Id ) );
var axIDcatXml = XElement.Parse( String.Format( @"<c:axId val=""{0}"" xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart""/>", categoryAxis.Id ) );
var axIDvalXml = XElement.Parse( String.Format( @"<c:axId val=""{0}"" xmlns:c=""http://schemas.openxmlformats.org/drawingml/2006/chart""/>", valueAxis.Id ) );

var gapWidth = this.ChartXml.Element( XName.Get( "gapWidth", Document.c.NamespaceName ) );
if( gapWidth != null )
Expand All @@ -238,8 +248,8 @@ public Chart()
this.ChartXml.Add( axIDvalXml );
}

plotAreaXml.Add( this.CategoryAxis.Xml );
plotAreaXml.Add( this.ValueAxis.Xml );
plotAreaXml.Add( categoryAxis.Xml );
plotAreaXml.Add( valueAxis.Xml );
}

this.ChartRootXml = this.Xml.Root.Element( XName.Get( "chart", Document.c.NamespaceName ) );
Expand Down Expand Up @@ -301,6 +311,33 @@ public void RemoveLegend()
}
}

public void Remove()
{
if( _packageRelationship.Package != null )
{
_packageRelationship.Package.DeletePart( _packageRelationship.TargetUri );
}

if( _parentParagraph.Document.PackagePart != null )
{
_parentParagraph.Document.PackagePart.DeleteRelationship( _packageRelationship.Id );
}

// Remove the Xml from document.
var parentParagrahChart = _parentParagraph.Xml.Descendants( XName.Get( "chart", Document.c.NamespaceName ) )
.FirstOrDefault( c => c.GetAttribute( XName.Get( "id", "http://schemas.openxmlformats.org/officeDocument/2006/relationships" ) ) == _packageRelationship.Id );
if( parentParagrahChart != null )
{
var parentDrawing = parentParagrahChart.Ancestors( XName.Get( "drawing", Document.w.NamespaceName ) ).FirstOrDefault();
if( parentDrawing != null )
{
parentDrawing.Remove();
}
}
}




#endregion

Expand Down Expand Up @@ -529,10 +566,10 @@ public void Bind( IList categories, IList values )
for( int index = 0; index < categories.Count; index++ )
{
pt = new XElement( XName.Get( "pt", Document.c.NamespaceName ), new XAttribute( XName.Get( "idx" ), index ),
new XElement( XName.Get( "v", Document.c.NamespaceName ), categories[ index ].ToString() ) );
new XElement( XName.Get( "v", Document.c.NamespaceName ), categories[index].ToString() ) );
_strCache.Add( pt );
pt = new XElement( XName.Get( "pt", Document.c.NamespaceName ), new XAttribute( XName.Get( "idx" ), index ),
new XElement( XName.Get( "v", Document.c.NamespaceName ), values[ index ].ToString() ) );
new XElement( XName.Get( "v", Document.c.NamespaceName ), values[index].ToString() ) );
_numCache.Add( pt );
}
}
Expand Down
17 changes: 15 additions & 2 deletions Xceed.Document.NET/Src/Container.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ public virtual List<List> Lists
}
}
}
lists.Add( list );

if( list.Items.Count > 0 )
{
lists.Add( list );
}

return lists;
}
}
Expand Down Expand Up @@ -1028,10 +1033,18 @@ private void InitParagraphs( List<Paragraph> paragraphs )
foreach( var p in paragraphs )
{
var nextElement = p.Xml.ElementsAfterSelf().FirstOrDefault();
if( ( nextElement == null ) && p.IsInSdt() )
if ((nextElement == null) && p.IsInSdt())
{
nextElement = p.GetParentSdt().ElementsAfterSelf().FirstOrDefault();
}
else if ((nextElement != null) && nextElement.Name.Equals(Document.w + "sdt"))
{
var sdtContent = nextElement.Element(XName.Get("sdtContent", Document.w.NamespaceName));
if (sdtContent != null)
{
nextElement = sdtContent.Element(XName.Get("tbl", Document.w.NamespaceName));
}
}
var containsSectionBreak = p.GetOrCreate_pPr().Element( XName.Get( "sectPr", Document.w.NamespaceName ) );
// Add FollowingTable to paragraph....only when paragraph is not the last one from a section.
while( ( nextElement != null ) && ( nextElement.Name.Equals( Document.w + "tbl" ) ) && ( containsSectionBreak == null ) )
Expand Down
4 changes: 3 additions & 1 deletion Xceed.Document.NET/Src/CustomProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ internal CustomProperty( string name, string type, string value, Formatting form

case "bool":
{
realValue = bool.Parse( value );
realValue = ( value == "0" )
? false
: ( value == "1" ) ? true : bool.Parse( value );
break;
}

Expand Down
Loading

0 comments on commit cb7170a

Please sign in to comment.