Print Library, Svg Library, Utils Library, XYPlots

This commit is contained in:
2026-07-24 13:36:46 -04:00
parent 06c3136566
commit f67d37801a
68 changed files with 12173 additions and 16618 deletions
+77 -128
View File
@@ -1,7 +1,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.ComponentModel;
using System.Text;
@@ -38,52 +37,39 @@ namespace Volian.Svg.Library
{
}
/// <summary>
/// <para>
/// Initializes a new instance of <see cref='SVGPart'/> based on another <see cref='SVGPart'/>.
/// </para>
/// </summary>
/// <param name='value'>
/// A <see cref='SVGPart'/> from which the contents are copied
/// </param>
public SvgParts(SvgParts value)
{
this.AddRange(value);
}
/// <summary>
/// <para>
/// Initializes a new instance of <see cref='SVGPart'/> based on another <see cref='SVGPart'/>.
/// </para>
/// </summary>
/// <param name='value'>
/// A <see cref='SVGPart'/> from which the contents are copied
/// </param>
public SvgParts(SvgParts value) => this.AddRange(value);
/// <summary>
/// <para>
/// Initializes a new instance of <see cref='SVGPart'/> containing any array of <see cref='SVGPart'/> objects.
/// </para>
/// </summary>
/// <param name='value'>
/// A array of <see cref='SVGPart'/> objects with which to intialize the collection
/// </param>
public SvgParts(SvgPart[] value)
{
this.AddRange(value);
}
/// <summary>
/// <para>
/// Initializes a new instance of <see cref='SVGPart'/> containing any array of <see cref='SVGPart'/> objects.
/// </para>
/// </summary>
/// <param name='value'>
/// A array of <see cref='SVGPart'/> objects with which to intialize the collection
/// </param>
public SvgParts(SvgPart[] value) => this.AddRange(value);
/// <summary>
/// <para>Represents the entry at the specified index of the <see cref='SVGPart'/>.</para>
/// </summary>
/// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
/// <value>
/// <para> The entry at the specified index of the collection.</para>
/// </value>
/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
public SvgPart this[int index]
/// <summary>
/// <para>Represents the entry at the specified index of the <see cref='SVGPart'/>.</para>
/// </summary>
/// <param name='index'><para>The zero-based index of the entry to locate in the collection.</para></param>
/// <value>
/// <para> The entry at the specified index of the collection.</para>
/// </value>
/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='index'/> is outside the valid range of indexes for the collection.</exception>
public SvgPart this[int index]
{
get { return ((SvgPart)(List[index])); }
set { List[index] = value; }
}
//#region SetupInheritance
//internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
//{
// foreach (SvgPart svgPart in List)
// svgPart.SetupInheritance(myParentsSettings);
//}
//#endregion
#region Dictionary of Parts
internal void AddLookup(Dictionary<string, SvgPart> lookUp)
{
@@ -194,29 +180,26 @@ namespace Volian.Svg.Library
List.CopyTo(array, index);
}
/// <summary>
/// <para>Returns the index of a <see cref='SVGPart'/> in
/// the <see cref='SVGPart'/> .</para>
/// </summary>
/// <param name='value'>The <see cref='SVGPart'/> to locate.</param>
/// <returns>
/// <para>The index of the <see cref='SVGPart'/> of <paramref name='value'/> in the
/// <see cref='SVGPart'/>, if found; otherwise, -1.</para>
/// </returns>
/// <seealso cref='SVGParts.Contains'/>
public int IndexOf(SvgPart value)
{
return List.IndexOf(value);
}
/// <summary>
/// <para>Returns the index of a <see cref='SVGPart'/> in
/// the <see cref='SVGPart'/> .</para>
/// </summary>
/// <param name='value'>The <see cref='SVGPart'/> to locate.</param>
/// <returns>
/// <para>The index of the <see cref='SVGPart'/> of <paramref name='value'/> in the
/// <see cref='SVGPart'/>, if found; otherwise, -1.</para>
/// </returns>
/// <seealso cref='SVGParts.Contains'/>
public int IndexOf(SvgPart value) => List.IndexOf(value);
/// <summary>
/// <para>Inserts a <see cref='SVGPart'/> into the <see cref='SVGParts'/> at the specified index.</para>
/// </summary>
/// <param name='index'>The zero-based index where <paramref name='value'/> should be inserted.</param>
/// <param name=' value'>The <see cref='SVGPart'/> to insert.</param>
/// <returns><para>None.</para></returns>
/// <seealso cref='SVGParts.Add'/>
public void Insert(int index, SvgPart value)
/// <summary>
/// <para>Inserts a <see cref='SVGPart'/> into the <see cref='SVGParts'/> at the specified index.</para>
/// </summary>
/// <param name='index'>The zero-based index where <paramref name='value'/> should be inserted.</param>
/// <param name=' value'>The <see cref='SVGPart'/> to insert.</param>
/// <returns><para>None.</para></returns>
/// <seealso cref='SVGParts.Add'/>
public void Insert(int index, SvgPart value)
{
List.Insert(index, value);
if (OnItemAdd != null) { OnItemAdd(this, new SVGPartArgs(value)); }
@@ -288,45 +271,25 @@ namespace Volian.Svg.Library
/// Event arguments for the SVGParts collection class.
public class SVGPartArgs : EventArgs
{
private SvgParts t;
/// Default constructor.
public SVGPartArgs()
{
t = new SvgParts();
}
/// Default constructor.
public SVGPartArgs() => SVGParts = new SvgParts();
/// Initializes with a SVGPart.
/// Data object.
public SVGPartArgs(SvgPart t)
: this()
{
this.t.Add(t);
}
/// Initializes with a SVGPart.
/// Data object.
public SVGPartArgs(SvgPart t) : this() => this.SVGParts.Add(t);
/// Initializes with a collection of SVGPart objects.
/// Collection of data.
public SVGPartArgs(SvgParts ts)
: this()
{
this.t.AddRange(ts);
}
/// Initializes with a collection of SVGPart objects.
/// Collection of data.
public SVGPartArgs(SvgParts ts) : this() => this.SVGParts.AddRange(ts);
/// Initializes with an array of SVGPart objects.
/// Array of data.
public SVGPartArgs(SvgPart[] ts)
: this()
{
this.t.AddRange(ts);
}
/// Initializes with an array of SVGPart objects.
/// Array of data.
public SVGPartArgs(SvgPart[] ts) : this() => this.SVGParts.AddRange(ts);
/// Gets or sets the data of this argument.
public SvgParts SVGParts
{
get { return t; }
set { t = value; }
}
}
/// Gets or sets the data of this argument.
public SvgParts SVGParts { get; set; }
}
/// SVGParts event handler.
public delegate void SVGPartHandler(object sender, SVGPartArgs e);
@@ -338,43 +301,29 @@ namespace Volian.Svg.Library
{
private SvgPart Item { get { return (SvgPart)_Item; } }
public SvgPartsPropertyDescriptor(SvgParts collection, int index) : base(collection, index) { ;}
public override string DisplayName
{ get { return Item.GetType().Name; } }
}
public override string DisplayName => Item.GetType().Name;
}
#endregion
[Serializable()]
public partial class vlnListPropertyDescriptor : PropertyDescriptor
{
protected object _Item = null;
public vlnListPropertyDescriptor(System.Collections.IList collection, int index)
: base("#" + index.ToString(), null)
{ _Item = collection[index]; }
public override bool CanResetValue(object component)
{ return true; }
public override Type ComponentType
{ get { return _Item.GetType(); } }
public override object GetValue(object component)
{ return _Item; }
public override bool IsReadOnly
{ get { return false; } }
public override Type PropertyType
{ get { return _Item.GetType(); } }
public override void ResetValue(object component)
public vlnListPropertyDescriptor(System.Collections.IList collection, int index)
: base($"#{index}", null) => _Item = collection[index];
public override bool CanResetValue(object component) => true;
public override Type ComponentType => _Item.GetType();
public override object GetValue(object component) => _Item;
public override bool IsReadOnly => false;
public override Type PropertyType => _Item.GetType();
public override void ResetValue(object component)
{ ;}
public override bool ShouldSerializeValue(object component)
{ return true; }
public override void SetValue(object component, object value)
{ /*_Item = value*/;}
//public override AttributeCollection Attributes
//{ get { return new AttributeCollection(null); } }
public override string DisplayName
{ get { return _Item.ToString(); } }
public override string Description
{ get { return _Item.ToString(); } }
public override string Name
{ get { return _Item.ToString(); } }
public override bool ShouldSerializeValue(object component) => true;
public override void SetValue(object component, object value) { /*_Item = value*/; }
public override string DisplayName => _Item.ToString();
public override string Description => _Item.ToString();
public override string Name => _Item.ToString();
} // Class
} // Class
#region Converter
internal class SVGPartsConverter : ExpandableObjectConverter
{
@@ -383,7 +332,7 @@ namespace Volian.Svg.Library
if (destType == typeof(string) && value is SvgParts)
{
// Return department and department role separated by comma.
return ((SvgParts)value).List.Count.ToString() + " SVG Drawing Parts";
return $"{((SvgParts)value).List.Count} SVG Drawing Parts";
}
return base.ConvertTo(context, culture, value, destType);
}