Remove in use files - Group 4
This commit is contained in:
1 parent
e1bf9a0f51
commit
ececbb7a35
47 files changed
-8785
No files matched your search
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
//public static class FontFind
|
||||
//{
|
||||
// public static string FileName(string fontName)
|
||||
// {
|
||||
// string baseFont = string.Empty;
|
||||
// Regex find = new Regex(fontName + @".* ?\(.*\)", RegexOptions.IgnoreCase);
|
||||
// RegistryKey regKey = Registry.LocalMachine.CreateSubKey(@"Software\Microsoft\Windows NT\CurrentVersion\Fonts");
|
||||
// string[] values = regKey.GetValueNames();
|
||||
// baseFont = regKey.GetValue(values[0]).ToString();
|
||||
// foreach (string valueName in regKey.GetValueNames())
|
||||
// {
|
||||
// if (find.IsMatch(valueName))
|
||||
// return regKey.GetValue(valueName).ToString();
|
||||
// }
|
||||
// return baseFont;
|
||||
// }
|
||||
// public static string FullFileName(string fontName)
|
||||
// {
|
||||
// return @"c:\windows\fonts\" + FileName(fontName);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Collections;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public abstract partial class SvgPart
|
||||
{
|
||||
public abstract void Draw(Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent);
|
||||
}
|
||||
public partial class SvgPartInheritance : SvgPart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
}
|
||||
}
|
||||
public partial class Svg : SvgGroup
|
||||
{
|
||||
public void Draw(Graphics graphics)
|
||||
{
|
||||
//SetupInheritance();
|
||||
//Console.WriteLine("{0}, DPI {1}", graphics.VisibleClipBounds, graphics.DpiX);
|
||||
SvgParts.Draw(graphics, new SvgScale(DeviceDPI(graphics), graphics.VisibleClipBounds, _Width, _Height, _ViewBox), this, this);
|
||||
//SvgParts.Draw(graphics, new SvgScale(100, graphics.VisibleClipBounds, _Width, _Height, _ViewBox));
|
||||
}
|
||||
public static float DeviceDPI(Graphics g)
|
||||
{
|
||||
PointF[] tmp = { new PointF(g.DpiX, g.DpiY) };
|
||||
g.TransformPoints(CoordinateSpace.World, CoordinateSpace.Device, tmp);
|
||||
return (float)Math.Round((double)tmp[0].X, 0);
|
||||
}
|
||||
}
|
||||
public partial class SvgArc : SvgShapePart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
//_MyLineSettings.Scale = scale.M(1F);
|
||||
if (FillColor != Color.Transparent)
|
||||
using (Brush brush = new SolidBrush(FillColor))
|
||||
graphics.FillEllipse(brush, scale.X(CX - Radius), scale.Y(CY - Radius), scale.M(Radius * 2), scale.M(Radius * 2));
|
||||
if (OutlineWidth.Value != 0F && OutlineColor != Color.Empty)
|
||||
using (Pen pen = new Pen(OutlineColor, scale.M(OutlineWidth)))
|
||||
graphics.DrawEllipse(pen, scale.X(CX - Radius), scale.Y(CY - Radius), scale.M(Radius * 2), scale.M(Radius * 2));
|
||||
}
|
||||
}
|
||||
public partial class SvgCircle : SvgShapePart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
//_MyLineSettings.Scale = scale.M(1F);
|
||||
if (FillColor != Color.Transparent)
|
||||
using (Brush brush = new SolidBrush(FillColor))
|
||||
graphics.FillEllipse(brush, scale.X(CX - Radius), scale.Y(CY - Radius), scale.M(Radius * 2), scale.M(Radius * 2));
|
||||
if (OutlineWidth.Value != 0F && OutlineColor != Color.Empty)
|
||||
using (Pen pen = new Pen(OutlineColor, scale.M(OutlineWidth)))
|
||||
graphics.DrawEllipse(pen, scale.X(CX - Radius), scale.Y(CY - Radius), scale.M(Radius * 2), scale.M(Radius * 2));
|
||||
}
|
||||
}
|
||||
public partial class SvgDefine : SvgGroup
|
||||
{
|
||||
public override void Draw(Graphics graphics, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
// Don't draw
|
||||
//_SvgParts.Draw(graphics, myScale);
|
||||
}
|
||||
}
|
||||
public partial class SvgEllipse : SvgShapePart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
if (FillColor != Color.Transparent)
|
||||
using (Brush brush = new SolidBrush(FillColor))
|
||||
graphics.FillEllipse(brush, scale.X(CX - RX), scale.Y(CY - RY), scale.M(2 * RX), scale.M(2 * RY));
|
||||
if (OutlineWidth.Value != 0F && OutlineColor != Color.Empty)
|
||||
using (Pen pen = new Pen(OutlineColor, scale.M(OutlineWidth)))
|
||||
graphics.DrawEllipse(pen, scale.X(CX - RX), scale.Y(CY - RY), scale.M(2 * RX), scale.M(2 * RY));
|
||||
}
|
||||
}
|
||||
public partial class SvgGroup : SvgPartInheritance
|
||||
{
|
||||
public override void Draw(Graphics graphics, SvgScale myScale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
_SvgParts.Draw(graphics, myScale, mySvg, this);
|
||||
}
|
||||
}
|
||||
public partial class SvgImage : SvgPart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
graphics.DrawImage(Image.FromFile(ImagePath), scale.X(X), scale.Y(Y), scale.M(Width), scale.M(Height));
|
||||
}
|
||||
}
|
||||
public partial class SvgLine : SvgLinePart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
if (LineColor != Color.Empty)
|
||||
{
|
||||
Color myColor = AdjustColorForWidth(LineColor, scale.M(LineWidth));
|
||||
using (Pen pen = new Pen(LineColor, scale.M(LineWidth)))
|
||||
graphics.DrawLine(pen, scale.X(X1), scale.Y(Y1), scale.X(X2), scale.Y(Y2));
|
||||
}
|
||||
}
|
||||
}
|
||||
public partial class SvgParts : CollectionBase
|
||||
{
|
||||
public void Draw(Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
foreach (SvgPart svgPart in List)
|
||||
svgPart.Draw(graphics,scale,mySvg, myParent);
|
||||
}
|
||||
}
|
||||
public partial class SvgRectangle : SvgShapePart
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
if (FillColor != Color.Transparent)
|
||||
using (Brush brush = new SolidBrush(FillColor))
|
||||
graphics.FillRectangle(brush, scale.X(X),scale.Y(Y),scale.M(Width),scale.M(Height));
|
||||
if (OutlineWidth.Value != 0F && OutlineColor != Color.Empty)
|
||||
using (Pen pen = new Pen(OutlineColor, scale.M(OutlineWidth)))
|
||||
graphics.DrawRectangle(pen, scale.X(X),scale.Y(Y), scale.M(Width), scale.M(Height));
|
||||
}
|
||||
}
|
||||
//public partial class SvgRtf : SvgShapePart
|
||||
//{
|
||||
// //private static float _Factor = 1.085F; // 20 point Arial Font
|
||||
// public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
// {
|
||||
// SetupInheritance(myParent.MyInheritedSettings);
|
||||
// _MyFontSettings.Scale = scale.M(1F);
|
||||
// }
|
||||
// private float YAdjustment(Graphics gr, Font fnt)
|
||||
// {
|
||||
// int yAsc = fnt.FontFamily.GetCellAscent(fnt.Style);
|
||||
// int yLS = fnt.FontFamily.GetLineSpacing(fnt.Style);
|
||||
// float gth = fnt.GetHeight(gr);
|
||||
// float fAsc = (yAsc * gth) / yLS;
|
||||
// return -fAsc;
|
||||
// }
|
||||
//}
|
||||
public partial class SvgText : SvgShapePart
|
||||
{
|
||||
//private static float _Factor = 1.085F; // 20 point Arial Font
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
_MyFontSettings.Scale = scale.M(1F);
|
||||
StringFormat stringFormat = StringFormat.GenericTypographic;
|
||||
float YAdj = YAdjustment(graphics, Font);
|
||||
using (Brush brush = new System.Drawing.SolidBrush(FillColor))
|
||||
graphics.DrawString(Text, Font, brush, scale.X(X), scale.Y(Y) + YAdj, stringFormat);
|
||||
SizeF sf = graphics.MeasureString(Text, Font, graphics.VisibleClipBounds.Size, stringFormat);
|
||||
if (OutlineWidth.Value != 0 && OutlineColor != Color.Empty)
|
||||
using (GraphicsPath path = GetStringPath(Text, Svg.DeviceDPI(graphics), new PointF(scale.X(X), scale.Y(Y) + YAdj), Font, stringFormat))
|
||||
using (Pen myPen = new Pen(OutlineColor, scale.M(OutlineWidth)))
|
||||
graphics.DrawPath(myPen, path);
|
||||
}
|
||||
GraphicsPath GetStringPath(string s, float dpi, PointF loc, Font font, StringFormat format)
|
||||
{
|
||||
GraphicsPath path = new GraphicsPath();
|
||||
// Convert font size into appropriate coordinates
|
||||
float emSize = dpi * font.SizeInPoints / 72;
|
||||
path.AddString(s, font.FontFamily, (int)font.Style, emSize, loc, format);
|
||||
return path;
|
||||
}
|
||||
private float YAdjustment(Graphics gr, Font fnt)
|
||||
{
|
||||
int yAsc = fnt.FontFamily.GetCellAscent(fnt.Style);
|
||||
//int yDesc = fnt.FontFamily.GetCellDescent(fnt.Style);
|
||||
//int yEm = fnt.FontFamily.GetEmHeight(fnt.Style);
|
||||
int yLS = fnt.FontFamily.GetLineSpacing(fnt.Style);
|
||||
float gth = fnt.GetHeight(gr);
|
||||
float fh = fnt.Size;
|
||||
float fAsc = (yAsc * gth) / yLS;
|
||||
return -fAsc;
|
||||
}
|
||||
}
|
||||
public partial class SvgUse : SvgPartInheritance
|
||||
{
|
||||
public override void Draw(System.Drawing.Graphics graphics, SvgScale scale, Svg mySvg, SvgPartInheritance myParent)
|
||||
{
|
||||
SetupInheritance(myParent.MyInheritedSettings);
|
||||
mySvg[_UseID.Substring(1)].Draw(graphics, scale.AdjustOrigin(X, Y), mySvg, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Volian.Svg.Library")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Volian.Svg.Library")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2010")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("40108f1d-d071-4978-9859-0c20c6b4b9cf")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,137 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
[XmlRoot("svg")]
|
||||
public partial class Svg : SvgGroup
|
||||
{
|
||||
private static System.Drawing.PointF _AbsoluteOffset;
|
||||
public static System.Drawing.PointF AbsoluteOffset
|
||||
{
|
||||
get { return Svg._AbsoluteOffset; }
|
||||
set { Svg._AbsoluteOffset = value; }
|
||||
}
|
||||
private static System.Drawing.Color _OverrrideColor = System.Drawing.Color.Empty;
|
||||
public static System.Drawing.Color OverrideColor
|
||||
{
|
||||
get { return Svg._OverrrideColor; }
|
||||
set { Svg._OverrrideColor = value; }
|
||||
}
|
||||
#region XML Serializer Namespaces
|
||||
private XmlSerializerNamespaces _Namespaces = null;
|
||||
[XmlNamespaceDeclarations]
|
||||
public XmlSerializerNamespaces Namespaces
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Namespaces == null)
|
||||
{
|
||||
_Namespaces = new XmlSerializerNamespaces();
|
||||
_Namespaces.Add("xlink", "http://www.w3.org/1999/xlink");
|
||||
}
|
||||
return _Namespaces;
|
||||
}
|
||||
set { _Namespaces = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Width
|
||||
private SvgMeasurement _Width = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Width
|
||||
{
|
||||
get { return _Width; }
|
||||
set { _Width = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("0")]
|
||||
[XmlAttribute("width")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Width_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Width); }
|
||||
set { _Width = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
//private string _Watermark="";
|
||||
//[XmlAttribute("watermark")]
|
||||
//public string Watermark
|
||||
//{
|
||||
// get { return _Watermark; }
|
||||
// set { _Watermark = value; }
|
||||
//}
|
||||
//public void SetValidWaterMark(string token, string watermark)
|
||||
//{
|
||||
// if (token == "{" + watermark.ToUpper() + "PAGE}" )
|
||||
// _Watermark = watermark;
|
||||
//}
|
||||
#endregion
|
||||
#region Height
|
||||
private SvgMeasurement _Height = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Height
|
||||
{
|
||||
get { return _Height; }
|
||||
set { _Height = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("0")]
|
||||
[XmlAttribute("height")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Height_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Height); }
|
||||
set { _Height = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region ViewBox
|
||||
private SvgViewBox _ViewBox = new SvgViewBox("0 0 0 0");
|
||||
[XmlIgnore]
|
||||
public SvgViewBox ViewBox
|
||||
{
|
||||
get { return _ViewBox; }
|
||||
set { _ViewBox = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("0 0 0 0")]
|
||||
[XmlAttribute("viewBox")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string SVGViewBox_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgViewBox>.GetString(_ViewBox); }
|
||||
set { _ViewBox = SvgXmlConverter<SvgViewBox>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
//#region Setup Inheritance
|
||||
//private void SetupInheritance()
|
||||
//{
|
||||
// SvgParts.SetupInheritance(_MyInheritedSettings);
|
||||
//}
|
||||
////override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
|
||||
////{
|
||||
//// _MyInheritedSettings.MyParentsSettings = myParentsSettings;
|
||||
//// SvgParts.SetupInheritance(_MyInheritedSettings);
|
||||
////}
|
||||
//#endregion
|
||||
#region Part Lookup
|
||||
private Dictionary<string, SvgPart> _LookUp;
|
||||
[XmlIgnore]
|
||||
internal Dictionary<string, SvgPart> LookUp
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_LookUp == null)
|
||||
{
|
||||
_LookUp = new Dictionary<string, SvgPart>();
|
||||
AddLookup(_LookUp);
|
||||
}
|
||||
return _LookUp;
|
||||
}
|
||||
}
|
||||
public SvgPart this[string id]
|
||||
{ get { return LookUp[id]; } }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgArc : SvgShapePart
|
||||
{
|
||||
#region ctor
|
||||
public SvgArc() { ;}
|
||||
public SvgArc(PointF location, float radius, float startAngle, float endAngle, Color fillColor, Color lineColor, float lineWidth)
|
||||
{
|
||||
_CX.Value = location.X;
|
||||
_CY.Value = location.Y;
|
||||
_Radius.Value = radius;
|
||||
FillColor = fillColor;
|
||||
LineColor = lineColor;
|
||||
LineWidth = new SvgMeasurement(lineWidth);
|
||||
}
|
||||
//XMLElementAttribute(ElementName = "PREFIX", IsNullable = false)
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgMeasurement _CX = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement CX
|
||||
{
|
||||
get { return _CX; }
|
||||
set { _CX = value; }
|
||||
}
|
||||
[XmlAttribute("cx")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string CX_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_CX); }
|
||||
set { _CX = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _CY = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement CY
|
||||
{
|
||||
get { return _CY; }
|
||||
set { _CY = value; }
|
||||
}
|
||||
[XmlAttribute("cy")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string CY_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_CY); }
|
||||
set { _CY = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Radius
|
||||
private SvgMeasurement _Radius = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Radius
|
||||
{
|
||||
get { return _Radius; }
|
||||
set { _Radius = value; }
|
||||
}
|
||||
[XmlAttribute("r")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Radius); }
|
||||
set { _Radius = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Angles
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgCircle : SvgShapePart
|
||||
{
|
||||
#region ctor
|
||||
public SvgCircle() { ;}
|
||||
public SvgCircle(PointF location, float radius, Color fillColor, Color lineColor, float lineWidth)
|
||||
{
|
||||
_CX.Value = location.X;
|
||||
_CY.Value = location.Y;
|
||||
_Radius.Value = radius;
|
||||
FillColor = fillColor;
|
||||
LineColor = lineColor;
|
||||
LineWidth = new SvgMeasurement(lineWidth);
|
||||
}
|
||||
//XMLElementAttribute(ElementName = "PREFIX", IsNullable = false)
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgMeasurement _CX = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement CX
|
||||
{
|
||||
get { return _CX; }
|
||||
set { _CX = value; }
|
||||
}
|
||||
[XmlAttribute("cx")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string CX_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_CX); }
|
||||
set { _CX = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _CY = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement CY
|
||||
{
|
||||
get { return _CY; }
|
||||
set { _CY = value; }
|
||||
}
|
||||
[XmlAttribute("cy")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string CY_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_CY); }
|
||||
set { _CY = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Radius
|
||||
private SvgMeasurement _Radius = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Radius
|
||||
{
|
||||
get { return _Radius; }
|
||||
set { _Radius = value; }
|
||||
}
|
||||
[XmlAttribute("r")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Radius); }
|
||||
set { _Radius = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgDefine : SvgGroup
|
||||
{
|
||||
// Nothing here - Draw definitions in individual modules
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgEllipse : SvgShapePart
|
||||
{
|
||||
#region ctor
|
||||
public SvgEllipse() { ;}
|
||||
public SvgEllipse(PointF location, float radiusX, float radiusY, Color fillColor, Color lineColor, float lineWidth)
|
||||
{
|
||||
_CX.Value = location.X;
|
||||
_CY.Value = location.Y;
|
||||
_RX.Value = radiusX;
|
||||
_RY.Value = radiusY;
|
||||
FillColor = fillColor;
|
||||
LineColor = lineColor;
|
||||
LineWidth = new SvgMeasurement(lineWidth);
|
||||
}
|
||||
//XMLElementAttribute(ElementName = "PREFIX", IsNullable = false)
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgMeasurement _CX = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement CX
|
||||
{
|
||||
get { return _CX; }
|
||||
set { _CX = value; }
|
||||
}
|
||||
[XmlAttribute("cx")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string CX_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_CX); }
|
||||
set { _CX = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _CY = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement CY
|
||||
{
|
||||
get { return _CY; }
|
||||
set { _CY = value; }
|
||||
}
|
||||
[XmlAttribute("cy")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string CY_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_CY); }
|
||||
set { _CY = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Size
|
||||
private SvgMeasurement _RX = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement RX
|
||||
{
|
||||
get { return _RX; }
|
||||
set { _RX = value; }
|
||||
}
|
||||
[XmlAttribute("rx")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string RX_RXmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_RX); }
|
||||
set { _RX = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _RY = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement RY
|
||||
{
|
||||
get { return _RY; }
|
||||
set { _RY = value; }
|
||||
}
|
||||
[XmlAttribute("ry")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string RY_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_RY); }
|
||||
set { _RY = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public class SvgFillSettings
|
||||
{
|
||||
#region ctor
|
||||
public SvgFillSettings() { ;}
|
||||
public SvgFillSettings(Color myColor)
|
||||
{
|
||||
_Fill = ColorTranslator.ToHtml(myColor);
|
||||
}
|
||||
//public SvgFillSettings(string myFill)
|
||||
//{
|
||||
// _Fill = myFill;
|
||||
//}
|
||||
#endregion
|
||||
#region Inheritance
|
||||
private SvgFillSettings _MyParentsSettings = null;
|
||||
public SvgFillSettings MyParentsSettings
|
||||
{
|
||||
get { return _MyParentsSettings; }
|
||||
set
|
||||
{
|
||||
_MyParentsSettings = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Internal Inherited Properties
|
||||
protected string InheritedFill
|
||||
{
|
||||
get
|
||||
{
|
||||
// Fill = "", "0" - Default, otherwise the value
|
||||
if (_Fill != "" && _Fill != "0" && _Fill.ToLower() != "empty") return _Fill; // Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedFill; // Inherited
|
||||
return "Black"; // Default
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Inherited Values
|
||||
public Color FillColor
|
||||
{
|
||||
get
|
||||
{
|
||||
// Fill = "None" - Eliminate, otherwise the value
|
||||
string myFill = InheritedFill;
|
||||
if (myFill.ToLower() == "none") // Eliminate
|
||||
return Color.Transparent;
|
||||
return ColorTranslator.FromHtml(myFill);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == Color.Transparent || value == Color.Empty)
|
||||
_Fill = "none";
|
||||
else
|
||||
_Fill = ColorTranslator.ToHtml(value);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Properties
|
||||
private string _Fill = string.Empty; // Default value is None
|
||||
public string Fill
|
||||
{
|
||||
get { return _Fill; }
|
||||
set { _Fill = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
class SvgFontSettings
|
||||
{
|
||||
#region ctor
|
||||
public SvgFontSettings() { ;}
|
||||
public SvgFontSettings(Font myFont)
|
||||
{
|
||||
_FontFamily = myFont.FontFamily.Name;
|
||||
_FontSize = myFont.SizeInPoints.ToString() + "PT";
|
||||
_SVGFontStyle = ((myFont.Style & FontStyle.Italic) == FontStyle.Italic ? "italic" : "normal");
|
||||
_FontWeight = ((myFont.Style & FontStyle.Bold) == FontStyle.Bold ? "bold" : "normal");
|
||||
_TextDecoration = ((myFont.Style & FontStyle.Underline) == FontStyle.Underline ? "underline" : "normal");
|
||||
}
|
||||
//public SvgFontSettings(string myFontFamily, string myFontSize, string mySvgStyle, string myFontWeight, string myTextDecoration)
|
||||
//{
|
||||
// _FontFamilyName = myFontFamily;
|
||||
// _FontSize = myFontSize;
|
||||
// _SVGFontStyle = mySvgStyle;
|
||||
// _FontWeight = myFontWeight;
|
||||
// _TextDecoration = myTextDecoration;
|
||||
//}
|
||||
#endregion
|
||||
#region Inheritance
|
||||
private SvgFontSettings _MyParentsSettings = null;
|
||||
public SvgFontSettings MyParentsSettings
|
||||
{
|
||||
get { return _MyParentsSettings; }
|
||||
set
|
||||
{
|
||||
_MyParentsSettings = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Internal Inherited Properties
|
||||
protected string InheritedFontFamily
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_FontFamily != "") return _FontFamily;
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedFontFamily; // Default
|
||||
return "Arial"; // Absolute Default
|
||||
}
|
||||
}
|
||||
protected string InheritedFontSize
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_FontSize != "") return _FontSize; // Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedFontSize; // Default
|
||||
return "9PT"; // Absolute Default
|
||||
}
|
||||
}
|
||||
protected string InheritedFontStyle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_SVGFontStyle != "") return _SVGFontStyle; // Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedFontStyle;// Default
|
||||
return "normal"; // Absolute Default
|
||||
}
|
||||
}
|
||||
protected string InheritedFontWeight
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_FontWeight != "") return _FontWeight;// Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedFontWeight;// Default
|
||||
return "normal"; // Absolute Default
|
||||
}
|
||||
}
|
||||
protected string InheritedTextDecoration
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_TextDecoration != "") return _TextDecoration;// Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedTextDecoration;// Default
|
||||
return "normal"; // Absolute Default
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Scale
|
||||
private float _Scale = 1;
|
||||
internal float Scale
|
||||
{
|
||||
get { return _Scale; }
|
||||
set { _Scale = value; Font = null; }
|
||||
}
|
||||
#endregion
|
||||
#region Inherited Values
|
||||
private Font _Font=null;
|
||||
public Font Font
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_Font == null)
|
||||
{
|
||||
_Font = new Font(InheritedFontFamily, _Scale * SvgMeasurement.StringToPoints(InheritedFontSize),
|
||||
(InheritedFontStyle == "italic" ? FontStyle.Italic : FontStyle.Regular) |
|
||||
(InheritedFontWeight == "bold" ? FontStyle.Bold : FontStyle.Regular) |
|
||||
(InheritedTextDecoration == "underline" ? FontStyle.Underline : FontStyle.Regular)
|
||||
, GraphicsUnit.Point);
|
||||
}
|
||||
return _Font;
|
||||
}
|
||||
set
|
||||
{
|
||||
// This was disposing fonts that are saved in our static dictionary.
|
||||
// caused problems with the step editor display after printing (found with Wolf Creek Chem procedure RW-G02 Step 6.1.17) - jsj 7/14/2017
|
||||
//if (_Font != null)
|
||||
//{
|
||||
// Console.WriteLine("font dispose {0}, {1}", _Font, _Font.Style);
|
||||
// //_Font.Dispose();
|
||||
//}
|
||||
if (value != null)
|
||||
{
|
||||
_FontFamily = value.FontFamily.Name;
|
||||
_FontSize = value.SizeInPoints.ToString() + "PT";
|
||||
_SVGFontStyle = ((value.Style & FontStyle.Italic) == FontStyle.Italic ? "italic" : "normal");
|
||||
_FontWeight = ((value.Style & FontStyle.Bold) == FontStyle.Bold ? "bold" : "normal");
|
||||
_TextDecoration = ((value.Style & FontStyle.Underline) == FontStyle.Underline ? "underline" : "normal");
|
||||
}
|
||||
_Font = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
private string _FontFamily = string.Empty;
|
||||
public string FontFamily
|
||||
{
|
||||
get { return _FontFamily; }
|
||||
set { _FontFamily = value; Font = null; }
|
||||
}
|
||||
private string _FontSize = string.Empty;
|
||||
public string FontSize
|
||||
{
|
||||
get { return _FontSize; }
|
||||
set { _FontSize = value; Font = null; }
|
||||
}
|
||||
private string _SVGFontStyle = string.Empty;
|
||||
public string SVGFontStyle
|
||||
{
|
||||
get { return _SVGFontStyle; }
|
||||
set { _SVGFontStyle = value; Font = null; }
|
||||
}
|
||||
private string _FontWeight = string.Empty;
|
||||
public string FontWeight
|
||||
{
|
||||
get { return _FontWeight; }
|
||||
set { _FontWeight = value; Font = null; }
|
||||
}
|
||||
private string _TextDecoration = string.Empty;
|
||||
public string TextDecoration
|
||||
{
|
||||
get { return _TextDecoration; }
|
||||
set { _TextDecoration = value; Font = null; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgGroup : SvgPartInheritance
|
||||
{
|
||||
#region Description
|
||||
private string _Description = string.Empty;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlElement("desc")]
|
||||
public string Description
|
||||
{
|
||||
get { return _Description; }
|
||||
set { _Description = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Title
|
||||
private string _Title = string.Empty;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlElement("title")]
|
||||
public string Title
|
||||
{
|
||||
get { return _Title; }
|
||||
set { _Title = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Parts
|
||||
// SVG Parts
|
||||
SvgParts _SvgParts = new SvgParts();
|
||||
//[XmlElement("foreignObject", typeof(SvgRtf))]
|
||||
[XmlElement("use", typeof(SvgUse))]
|
||||
[XmlElement("image", typeof(SvgImage))]
|
||||
[XmlElement("text", typeof(SvgText))]
|
||||
[XmlElement("line", typeof(SvgLine))]
|
||||
[XmlElement("circle", typeof(SvgCircle))]
|
||||
[XmlElement("rect", typeof(SvgRectangle))]
|
||||
[XmlElement("ellipse", typeof(SvgEllipse))]
|
||||
[XmlElement("svg", typeof(Svg))]
|
||||
[XmlElement("g", typeof(SvgGroup))]
|
||||
[XmlElement("defs", typeof(SvgDefine))]
|
||||
public SvgParts SvgParts
|
||||
{
|
||||
get { return _SvgParts; }
|
||||
set { _SvgParts = value; }
|
||||
}
|
||||
public SvgPart Add(SvgPart svgPart)
|
||||
{
|
||||
_SvgParts.Add(svgPart);
|
||||
return svgPart;
|
||||
}
|
||||
public void RemoveAt(int i)
|
||||
{
|
||||
_SvgParts.RemoveAt(i);
|
||||
}
|
||||
public int Count
|
||||
{ get { return _SvgParts.Count; } }
|
||||
#endregion
|
||||
#region Dictionary of Parts
|
||||
internal override void AddLookup(Dictionary<string, SvgPart> lookUp)
|
||||
{
|
||||
base.AddLookup(lookUp);
|
||||
SvgParts.AddLookup(lookUp);
|
||||
}
|
||||
#endregion
|
||||
public override string ToString()
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgImage : SvgPart
|
||||
{
|
||||
#region ctor
|
||||
public SvgImage() { ;}
|
||||
public SvgImage(PointF location, SizeF size, string path)
|
||||
{
|
||||
_X.Value = location.X;
|
||||
_Y.Value = location.Y;
|
||||
_Width.Value = size.Width;
|
||||
_Height.Value = size.Height;
|
||||
_ImagePath = path;
|
||||
}
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgMeasurement _X = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement X
|
||||
{
|
||||
get { return _X; }
|
||||
set { _X = value; }
|
||||
}
|
||||
[XmlAttribute("x")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_X); }
|
||||
set { _X = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Y = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Y
|
||||
{
|
||||
get { return _Y; }
|
||||
set { _Y = value; }
|
||||
}
|
||||
[XmlAttribute("y")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Y_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Y); }
|
||||
set { _Y = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Size
|
||||
private SvgMeasurement _Width = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Width
|
||||
{
|
||||
get { return _Width; }
|
||||
set { _Width = value; }
|
||||
}
|
||||
[XmlAttribute("width")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Width_WidthmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Width); }
|
||||
set { _Width = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Height = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Height
|
||||
{
|
||||
get { return _Height; }
|
||||
set { _Height = value; }
|
||||
}
|
||||
[XmlAttribute("height")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Height_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Height); }
|
||||
set { _Height = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Path to Image File
|
||||
private string _ImagePath = null;
|
||||
[XmlAttribute(AttributeName = "href", Namespace = "http://www.w3.org/1999/xlink")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string ImagePath
|
||||
{
|
||||
get { return _ImagePath; }
|
||||
set { _ImagePath = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
internal class SvgInheritedSettings
|
||||
{
|
||||
#region MyParent
|
||||
SvgInheritedSettings _MyParentsSettings = null;
|
||||
internal SvgInheritedSettings MyParentsSettings
|
||||
{
|
||||
get { return _MyParentsSettings; }
|
||||
set
|
||||
{
|
||||
_MyParentsSettings = value;
|
||||
MyLineSettings.MyParentsSettings = value.MyLineSettings;
|
||||
MyFillSettings.MyParentsSettings = value.MyFillSettings;
|
||||
MyFontSettings.MyParentsSettings = value.MyFontSettings;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Line Settings
|
||||
private SvgLineSettings _MyLineSettings = new SvgLineSettings();
|
||||
public SvgLineSettings MyLineSettings
|
||||
{
|
||||
get { return _MyLineSettings; }
|
||||
set { _MyLineSettings = value; }
|
||||
}
|
||||
public string Stroke
|
||||
{
|
||||
get { return _MyLineSettings.Stroke; }
|
||||
set { _MyLineSettings.Stroke = value; }
|
||||
}
|
||||
public string StrokeWidth
|
||||
{
|
||||
get { return _MyLineSettings.StrokeWidth; }
|
||||
set { _MyLineSettings.StrokeWidth = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Fill Settings
|
||||
private SvgFillSettings _MyFillSettings = new SvgFillSettings();
|
||||
internal SvgFillSettings MyFillSettings
|
||||
{
|
||||
get { return _MyFillSettings; }
|
||||
set { _MyFillSettings = value; }
|
||||
}
|
||||
public string Fill
|
||||
{
|
||||
get { return _MyFillSettings.Fill; }
|
||||
set { _MyFillSettings.Fill = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Font Settings
|
||||
private SvgFontSettings _MyFontSettings = new SvgFontSettings();
|
||||
internal SvgFontSettings MyFontSettings
|
||||
{
|
||||
get { return _MyFontSettings; }
|
||||
set { _MyFontSettings = value; }
|
||||
}
|
||||
public string FontFamily
|
||||
{
|
||||
get { return _MyFontSettings.FontFamily; }
|
||||
set { _MyFontSettings.FontFamily = value; }
|
||||
}
|
||||
public string FontSize
|
||||
{
|
||||
get { return _MyFontSettings.FontSize; }
|
||||
set { _MyFontSettings.FontSize = value; }
|
||||
}
|
||||
public string SVGFontStyle
|
||||
{
|
||||
get { return _MyFontSettings.SVGFontStyle; }
|
||||
set { _MyFontSettings.SVGFontStyle = value; }
|
||||
}
|
||||
public string FontWeight
|
||||
{
|
||||
get { return _MyFontSettings.FontWeight; }
|
||||
set { _MyFontSettings.FontWeight = value; }
|
||||
}
|
||||
public string TextDecoration
|
||||
{
|
||||
get { return _MyFontSettings.TextDecoration; }
|
||||
set { _MyFontSettings.TextDecoration = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,158 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgLine : SvgLinePart
|
||||
{
|
||||
#region ctor
|
||||
public SvgLine() { ;}
|
||||
public SvgLine(PointF location1, PointF location2, Color lineColor, float lineWidth)
|
||||
{
|
||||
_X1.Value = location1.X;
|
||||
_Y1.Value = location1.Y;
|
||||
_X2.Value = location2.X;
|
||||
_Y2.Value = location2.Y;
|
||||
LineColor = lineColor;
|
||||
LineWidth = new SvgMeasurement(lineWidth);
|
||||
}
|
||||
//XMLElementAttribute(ElementName = "PREFIX", IsNullable = false)
|
||||
#endregion
|
||||
#region Location1
|
||||
private SvgMeasurement _X1 = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement X1
|
||||
{
|
||||
get { return _X1; }
|
||||
set { _X1 = value; }
|
||||
}
|
||||
[XmlAttribute("x1")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X1_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_X1); }
|
||||
set { _X1 = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Y1 = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Y1
|
||||
{
|
||||
get { return _Y1; }
|
||||
set { _Y1 = value; }
|
||||
}
|
||||
[XmlAttribute("y1")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Y1_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Y1); }
|
||||
set { _Y1 = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Location2
|
||||
private SvgMeasurement _X2 = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement X2
|
||||
{
|
||||
get { return _X2; }
|
||||
set { _X2 = value; }
|
||||
}
|
||||
[XmlAttribute("x2")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X2_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_X2); }
|
||||
set { _X2 = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Y2 = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Y2
|
||||
{
|
||||
get { return _Y2; }
|
||||
set { _Y2 = value; }
|
||||
}
|
||||
[XmlAttribute("y2")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Y_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Y2); }
|
||||
set { _Y2 = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Description
|
||||
private string _Description = string.Empty;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlElement("desc")]
|
||||
public string Description
|
||||
{
|
||||
get { return _Description; }
|
||||
set { _Description = value; }
|
||||
}
|
||||
#endregion
|
||||
#region LineColor
|
||||
//protected Color _LineColor = Color.Empty;
|
||||
//[XmlIgnoreAttribute()]
|
||||
//public Color LineColor
|
||||
//{
|
||||
// get { return _LineWidth.Value == 0 ? Color.LightGray : _LineColor == Color.Empty ? Color.Gray : _LineColor; }
|
||||
// set { _LineColor = value; }
|
||||
//}
|
||||
private Color AdjustColorForWidth(Color myColor, float myWidth)
|
||||
{
|
||||
if (myWidth > 1F) return myColor;
|
||||
//Console.WriteLine("Line Width = {0}, Alpha = {1}", myWidth, Convert.ToInt32(myWidth * 255));
|
||||
return Color.FromArgb(Convert.ToInt32(myWidth * 255), myColor);
|
||||
}
|
||||
// Serializes the 'BackgroundColor' Color to XML.
|
||||
//[System.ComponentModel.DefaultValueAttribute("none")]
|
||||
//[XmlAttribute("stroke")]
|
||||
//public string Stroke
|
||||
//{
|
||||
// get { return _LineColor == Color.Empty ? "none" : _LineColor == Color.Black ? "" : ColorTranslator.ToHtml(_LineColor); }
|
||||
// set { _LineColor = (value == "none" ? Color.Empty : (value == "" ? Color.Empty : ColorTranslator.FromHtml(value))); }
|
||||
//}
|
||||
#endregion
|
||||
#region LineWidth
|
||||
//private SvgMeasurement GetLineWidth()
|
||||
//{
|
||||
// if (_LineWidth.Value == -1) return new SvgMeasurement(1F);// Minimum Strokewidth
|
||||
// if (_LineWidth.Value == 0) return new SvgMeasurement(.01F);// Minimum Strokewidth
|
||||
// if (_LineColor == Color.Empty) return new SvgMeasurement( .01F);// No Color - Minimum Strokewidth
|
||||
// return _LineWidth;
|
||||
//}
|
||||
//private SvgMeasurement _LineWidth = new SvgMeasurement();
|
||||
//[XmlIgnore]
|
||||
//public SvgMeasurement LineWidth
|
||||
//{
|
||||
// get { return _LineWidth; }
|
||||
// set { _LineWidth = value; }
|
||||
//}
|
||||
//[XmlAttribute("stroke-width")]
|
||||
//[Browsable(false)]
|
||||
//[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
//public string LineWidth_XmlSurrogate
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// if (_LineWidth.Value == -1)
|
||||
// return "none";
|
||||
// return VolianXmlConverter<SvgMeasurement>.GetString(_LineWidth);
|
||||
// }
|
||||
// set
|
||||
// {
|
||||
// if (value == "none")
|
||||
// _LineWidth = VolianXmlConverter<SvgMeasurement>.GetObject("-1");
|
||||
// else
|
||||
// _LineWidth = VolianXmlConverter<SvgMeasurement>.GetObject(value);
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public abstract class SvgLinePart : SvgPart
|
||||
{
|
||||
#region Line Settings
|
||||
protected SvgLineSettings _MyLineSettings = new SvgLineSettings();
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("stroke")]
|
||||
public string Stroke
|
||||
{
|
||||
get { return _MyLineSettings.Stroke; }
|
||||
set { _MyLineSettings.Stroke = value; }
|
||||
}
|
||||
[XmlIgnore]
|
||||
protected Color LineColor
|
||||
{
|
||||
get { return Svg.OverrideColor != System.Drawing.Color.Empty ? Svg.OverrideColor : _MyLineSettings.LineColor; }
|
||||
set { _MyLineSettings.LineColor = value; }
|
||||
}
|
||||
[XmlIgnore]
|
||||
protected Color OutlineColor
|
||||
{
|
||||
get { return Svg.OverrideColor != System.Drawing.Color.Empty ? Svg.OverrideColor :_MyLineSettings.OutlineColor; }
|
||||
set { _MyLineSettings.OutlineColor = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("stroke-width")]
|
||||
public string StrokeWidth
|
||||
{
|
||||
get { return _MyLineSettings.StrokeWidth; }
|
||||
set { _MyLineSettings.StrokeWidth = value; }
|
||||
}
|
||||
[XmlIgnore]
|
||||
protected SvgMeasurement LineWidth
|
||||
{
|
||||
get { return _MyLineSettings.LineWidth; }
|
||||
set { _MyLineSettings.LineWidth = value; }
|
||||
}
|
||||
[XmlIgnore]
|
||||
protected SvgMeasurement OutlineWidth
|
||||
{
|
||||
get { return _MyLineSettings.OutlineWidth; }
|
||||
set { _MyLineSettings.OutlineWidth = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Setup Inheritance
|
||||
override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
|
||||
{
|
||||
_MyLineSettings.MyParentsSettings = myParentsSettings.MyLineSettings;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,167 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public class SvgLineSettings
|
||||
{
|
||||
#region ctor
|
||||
public SvgLineSettings() { ;}
|
||||
public SvgLineSettings(Color myColor, SvgMeasurement myWidth)
|
||||
{
|
||||
_Stroke = ColorTranslator.ToHtml(myColor);
|
||||
_StrokeWidth = myWidth.ToString();
|
||||
}
|
||||
//public SvgLineSettings(string myStroke, string myStrokeWidth)
|
||||
//{
|
||||
// _Stroke = myStroke;
|
||||
// _StrokeWidth = myStrokeWidth;
|
||||
//}
|
||||
#endregion
|
||||
#region Inheritance
|
||||
private SvgLineSettings _MyParentsSettings = null;
|
||||
public SvgLineSettings MyParentsSettings
|
||||
{
|
||||
get { return _MyParentsSettings; }
|
||||
set
|
||||
{
|
||||
_MyParentsSettings = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region Internal Inherited Properties
|
||||
protected string InheritedStroke
|
||||
{
|
||||
get
|
||||
{
|
||||
// Stroke = "", "0" - Default, otherwise the value
|
||||
if (_Stroke != "" && _Stroke != "0") return _Stroke; // Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedStroke;// Inherited
|
||||
return "None"; // Default
|
||||
}
|
||||
}
|
||||
protected string InheritedLineWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
// StrokeWidth = "", "none" - Default, otherwise the value
|
||||
if (_StrokeWidth != "" && _StrokeWidth != "none") return _StrokeWidth; // Current Value
|
||||
if (_MyParentsSettings != null) return _MyParentsSettings.InheritedLineWidth; // Inherited
|
||||
return "1PX"; // Default
|
||||
}
|
||||
}
|
||||
//protected string InheritedOutlineWidth
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// // StrokeWidth = "", "none" - Default, otherwise the value
|
||||
// if (_StrokeWidth != "" && _StrokeWidth.ToLower() != "none") return _StrokeWidth; // Current Value
|
||||
// if (_MyParent != null) return _MyParent.InheritedLineWidth; // Inherited
|
||||
// return "1PX"; // Default
|
||||
// }
|
||||
//}
|
||||
#endregion
|
||||
#region Inherited Values
|
||||
public SvgMeasurement LineWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
// Stroke = "None" - Light, otherwise the value
|
||||
// StrokeWidth = "None" Light, otherwise the value
|
||||
string myStroke = InheritedStroke;
|
||||
string myWidth = InheritedLineWidth;
|
||||
//if (myStroke.ToLower() == "none" || myWidth.ToLower() == "none") // Light
|
||||
// return new SvgMeasurement(.001F, E_MeasurementUnits.PX);
|
||||
SvgMeasurement myMeasurement = new SvgMeasurement(myWidth);
|
||||
//myMeasurement.Value *= _Scale;
|
||||
return myMeasurement;
|
||||
}
|
||||
set
|
||||
{
|
||||
_StrokeWidth = value.ToString();
|
||||
}
|
||||
}
|
||||
public SvgMeasurement OutlineWidth
|
||||
{
|
||||
get
|
||||
{
|
||||
// Stroke = "None" - Eliminate, otherwise the value
|
||||
// StrokeWidth = "0" Eliminate, otherwise the value
|
||||
string myStroke = InheritedStroke;
|
||||
//string myWidth = InheritedOutlineWidth;
|
||||
string myWidth = InheritedLineWidth;
|
||||
if (myStroke.ToLower() == "none" || myWidth == "0") // Eliminate
|
||||
return new SvgMeasurement(0, E_MeasurementUnits.PX);
|
||||
SvgMeasurement myMeasurement = new SvgMeasurement(myWidth);
|
||||
//myMeasurement.Value *= _Scale;
|
||||
return myMeasurement;
|
||||
}
|
||||
set
|
||||
{
|
||||
_StrokeWidth = value.ToString();
|
||||
}
|
||||
}
|
||||
public Color LineColor
|
||||
{
|
||||
get
|
||||
{
|
||||
// Stroke = "None" - Eliminate, otherwise the value
|
||||
// StrokeWidth = "None" Eliminate, otherwise the value
|
||||
string myStroke = InheritedStroke;
|
||||
string myWidth = InheritedLineWidth;
|
||||
if (myStroke.ToLower() == "none" || myWidth.ToLower() == "none" || myWidth == "0") // Light
|
||||
return Color.LightGray;
|
||||
return ColorTranslator.FromHtml(myStroke);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == Color.Empty)
|
||||
_Stroke = "none";
|
||||
else
|
||||
_Stroke = ColorTranslator.ToHtml(value);
|
||||
}
|
||||
|
||||
}
|
||||
public Color OutlineColor
|
||||
{
|
||||
get
|
||||
{
|
||||
// Stroke = "None" - Eliminate, otherwise the value
|
||||
// StrokeWidth = "0" Eliminate, otherwise the value
|
||||
string myStroke = InheritedStroke;
|
||||
//string myWidth = InheritedOutlineWidth;
|
||||
string myWidth = InheritedLineWidth;
|
||||
if (myStroke.ToLower() == "none" || myWidth == "0") // Eliminate
|
||||
return Color.Empty;
|
||||
return ColorTranslator.FromHtml(myStroke);
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value == Color.Empty)
|
||||
_Stroke = "none";
|
||||
else
|
||||
_Stroke = ColorTranslator.ToHtml(value);
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
#region Properties
|
||||
private string _Stroke = string.Empty; // Default value is None
|
||||
public string Stroke
|
||||
{
|
||||
get { return _Stroke; }
|
||||
set { _Stroke = value; }
|
||||
}
|
||||
private string _StrokeWidth = string.Empty; // Default value is 1PX
|
||||
public string StrokeWidth
|
||||
{
|
||||
get { return _StrokeWidth; }
|
||||
set { _StrokeWidth = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
[TypeConverter(typeof(MeasurementTypeConverter))]
|
||||
public class SvgMeasurement
|
||||
{
|
||||
#region Operators
|
||||
public static SvgMeasurement operator +(SvgMeasurement x1, SvgMeasurement x2)
|
||||
{
|
||||
E_MeasurementUnits tmpUnits = x1.Units;
|
||||
SvgMeasurement tmp = new SvgMeasurement(x1.GetSizeInPoints(DPI) + x2.GetSizeInPoints(DPI),E_MeasurementUnits.PT);
|
||||
tmp.Units = x1.Units;
|
||||
return tmp;
|
||||
}
|
||||
public static SvgMeasurement operator -(SvgMeasurement x1, SvgMeasurement x2)
|
||||
{
|
||||
E_MeasurementUnits tmpUnits = x1.Units;
|
||||
SvgMeasurement tmp = new SvgMeasurement(x1.GetSizeInPoints(DPI) - x2.GetSizeInPoints(DPI), E_MeasurementUnits.PT);
|
||||
tmp.Units = x1.Units;
|
||||
return tmp;
|
||||
}
|
||||
public static SvgMeasurement operator *(SvgMeasurement x1, float scaler)
|
||||
{
|
||||
E_MeasurementUnits tmpUnits = x1.Units;
|
||||
SvgMeasurement tmp = new SvgMeasurement(x1.GetSizeInPoints(DPI) * scaler, E_MeasurementUnits.PT);
|
||||
tmp.Units = x1.Units;
|
||||
return tmp;
|
||||
}
|
||||
public static SvgMeasurement operator *(float scaler, SvgMeasurement x1)
|
||||
{
|
||||
E_MeasurementUnits tmpUnits = x1.Units;
|
||||
SvgMeasurement tmp = new SvgMeasurement(x1.GetSizeInPoints(DPI) * scaler, E_MeasurementUnits.PT);
|
||||
tmp.Units = x1.Units;
|
||||
return tmp;
|
||||
}
|
||||
#endregion
|
||||
#region DPI
|
||||
private static float _DPI;
|
||||
public static float DPI
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_DPI == 0)
|
||||
_DPI = 96;
|
||||
return _DPI;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#region ctor
|
||||
public SvgMeasurement() { ;}
|
||||
public SvgMeasurement(int value)
|
||||
{
|
||||
_Value = Convert.ToSingle(value);
|
||||
_Units = E_MeasurementUnits.PX;
|
||||
}
|
||||
public SvgMeasurement(float value)
|
||||
{
|
||||
_Value = value;
|
||||
_Units = E_MeasurementUnits.PX;
|
||||
}
|
||||
public SvgMeasurement(float value, E_MeasurementUnits units)
|
||||
{
|
||||
_Value = value;
|
||||
_Units = units;
|
||||
}
|
||||
public SvgMeasurement(string val)
|
||||
{
|
||||
val = val.Replace("{size}", "10");// B2020-145 BWD SAMG TSG-6 Fix for Base Format {size} parameter rather than font size
|
||||
MatchCollection mc = Regex.Matches(val.ToLower(), "([+-]?[.0-9]+)|(in|cm|mm|em|ex|pc|pt|px|percentage)");
|
||||
_Value = Convert.ToSingle(mc[0].Value);
|
||||
if (mc.Count == 2)
|
||||
{
|
||||
//Console.WriteLine("{0} - '{1}'", val, mc[1].Value.ToUpper());
|
||||
_Units = (E_MeasurementUnits)Enum.Parse(typeof(E_MeasurementUnits), mc[1].Value.ToUpper());
|
||||
}
|
||||
else
|
||||
_Units = E_MeasurementUnits.PX;
|
||||
}
|
||||
#endregion
|
||||
#region Properties
|
||||
private E_MeasurementUnits _Units;
|
||||
public E_MeasurementUnits Units
|
||||
{
|
||||
get { return _Units; }
|
||||
set
|
||||
{
|
||||
float tmp = GetSizeInPoints(DPI);
|
||||
_Units = value;
|
||||
_Value *= (tmp / GetSizeInPoints(DPI));
|
||||
}
|
||||
}
|
||||
private float _Value;
|
||||
public float Value
|
||||
{
|
||||
get { return _Value; }
|
||||
set { _Value = value; }
|
||||
}
|
||||
#endregion
|
||||
#region ToString
|
||||
public override string ToString()
|
||||
{
|
||||
switch (_Units)
|
||||
{
|
||||
case E_MeasurementUnits.PX: // Default
|
||||
return string.Format("{0}", _Value);
|
||||
case E_MeasurementUnits.PERCENTAGE: // Precentage is preceded by a space
|
||||
return string.Format("{0} {1}", _Value, _Units);
|
||||
}
|
||||
return string.Format("{0}{1}", _Value, _Units);
|
||||
}
|
||||
#endregion
|
||||
//public float SizeInPixels
|
||||
//{
|
||||
// get
|
||||
// {
|
||||
// switch (_Units)
|
||||
// {
|
||||
// case E_MeasurementUnits.PT: //Points - 72 per inch
|
||||
// return _Value * DPI / 72F;
|
||||
// case E_MeasurementUnits.PC: //Picas - 6 per inch
|
||||
// return _Value * DPI / 6F;
|
||||
// case E_MeasurementUnits.IN: //inches
|
||||
// return _Value * DPI;
|
||||
// case E_MeasurementUnits.CM: // Centimeter
|
||||
// return _Value * DPI / 2.54F;
|
||||
// case E_MeasurementUnits.MM: // Millimeter
|
||||
// return _Value * DPI / 25.4F;
|
||||
// case E_MeasurementUnits.EM: // EMs
|
||||
// return _Value * DPI / 8;
|
||||
// case E_MeasurementUnits.EX: // EXs
|
||||
// return _Value * DPI / 16;
|
||||
// default:
|
||||
// return _Value;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
public float GetSizeInPoints(float myDPI)
|
||||
{
|
||||
switch (_Units)
|
||||
{
|
||||
case E_MeasurementUnits.PX: //Pixels myDPI per inch
|
||||
return _Value * 72F / myDPI;
|
||||
case E_MeasurementUnits.PC: //Picas - 6 per inch
|
||||
return _Value * 72F / 6F;
|
||||
case E_MeasurementUnits.IN: //inches
|
||||
return _Value * 72F;
|
||||
case E_MeasurementUnits.CM: // Centimeter
|
||||
return _Value * 72F / 2.54F;
|
||||
case E_MeasurementUnits.MM: // Millimeter
|
||||
return _Value * 72F / 25.4F;
|
||||
case E_MeasurementUnits.EM: // EMs
|
||||
return _Value * 72F / 8;
|
||||
case E_MeasurementUnits.EX: // EXs
|
||||
return _Value * 72F / 16;
|
||||
default: // Points
|
||||
return _Value;
|
||||
}
|
||||
}
|
||||
//public float SizeInPoints
|
||||
//{ get { return SizeInPixels * 72 / DPI; } }
|
||||
//public float SizeInInches
|
||||
//{ get { return SizeInPixels / DPI; } }
|
||||
//public float SizeInCentimeters
|
||||
//{ get { return SizeInPixels * 2.54F / DPI; } }
|
||||
//public float SizeInMillimeters
|
||||
//{ get { return SizeInPixels * 25.4F / DPI; } }
|
||||
//public float SizeInEms
|
||||
//{ get { return SizeInPixels * 5 / (6 * DPI); } }
|
||||
//public float SizeInExs
|
||||
//{ get { return SizeInPixels * 5 / (6 * DPI); } }
|
||||
//public float SizeInPicas
|
||||
//{ get { return SizeInPixels * 6 / DPI; } }
|
||||
//public Unit SizeInUnits
|
||||
//{ get { return new Unit((double)SizeInPoints, UnitTypeEnum.Point); } }
|
||||
public float GetSizeInPixels(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) * myDPI / 72F;}
|
||||
public float GetSizeInInches(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) / 72F; }
|
||||
public float GetSizeInCentimeters(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) * 2.54F / 72F; }
|
||||
public float GetSizeInMillimeters(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) * 25.4F / 72F; }
|
||||
public float GetSizeInEms(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) * 5 / (6 * 72F); }
|
||||
public float GetSizeInExs(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) * 5 / (6 * 72F); }
|
||||
public float GetSizeInPicas(float myDPI)
|
||||
{ return GetSizeInPoints(myDPI) * 6 / 72F; }
|
||||
//public Unit GetSizeInUnits(float myDPI)
|
||||
//{ return new Unit((double)GetSizeInPoints(myDPI), UnitTypeEnum.Point); }
|
||||
public static float StringToPoints(string value)
|
||||
{
|
||||
SvgMeasurement tmp = new SvgMeasurement(value);
|
||||
float myPoints = tmp.GetSizeInPoints(72);
|
||||
return myPoints;
|
||||
}
|
||||
|
||||
}
|
||||
public enum E_MeasurementUnits : int
|
||||
{
|
||||
[Description("Pixels")]
|
||||
PX,
|
||||
[Description("Points")]
|
||||
PT,
|
||||
[Description("Inches")]
|
||||
IN,
|
||||
[Description("Centimeters")]
|
||||
CM,
|
||||
[Description("Millimeters")]
|
||||
MM,
|
||||
[Description("EMs")]
|
||||
EM,
|
||||
[Description("EXs")]
|
||||
EX,
|
||||
[Description("Percentage")]
|
||||
PERCENTAGE,
|
||||
[Description("Picas")]
|
||||
PC
|
||||
}
|
||||
public class MeasurementTypeConverter : ExpandableObjectConverter
|
||||
{
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type t)
|
||||
{
|
||||
return t == typeof(String);
|
||||
}
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
|
||||
{
|
||||
if (destType == typeof(string) && value is SvgMeasurement)
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destType);
|
||||
}
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type t)
|
||||
{
|
||||
return t == typeof(String);
|
||||
}
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object val)
|
||||
{
|
||||
SvgMeasurement measurement = new SvgMeasurement((string)val);
|
||||
return measurement;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public abstract partial class SvgPart
|
||||
{
|
||||
#region ID
|
||||
protected string _ID = string.Empty;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("id")]
|
||||
public string ID
|
||||
{
|
||||
get { return _ID; }
|
||||
set { _ID = value; }
|
||||
}
|
||||
#endregion
|
||||
//#region Parent and Containing Svg
|
||||
//// ToDo: MyParent
|
||||
//private SvgPartGrouping _MyParent;
|
||||
//[XmlIgnore()]
|
||||
//public SvgPartGrouping MyParent
|
||||
//{
|
||||
// get { return _MyParent; }
|
||||
// set { _MyParent = value; }
|
||||
//}
|
||||
//// ToDo: MySvg
|
||||
//private Svg _MySvg;
|
||||
//public Svg MySvg
|
||||
//{
|
||||
// get { return _MySvg; }
|
||||
// set { _MySvg = value; }
|
||||
//}
|
||||
//internal void SetParent(SvgPartGrouping myParent)
|
||||
//{
|
||||
// _MyParent = myParent;
|
||||
// _MySvg = myParent.MySvg == null? MyParent : myParent.MySvg;
|
||||
//}
|
||||
//#endregion
|
||||
#region Setup Inheritance
|
||||
virtual internal void SetupInheritance(SvgInheritedSettings myParentsSettings) { ; }
|
||||
#endregion
|
||||
#region Dictionary of Parts
|
||||
internal virtual void AddLookup(Dictionary<string, SvgPart> lookUp)
|
||||
{
|
||||
if (_ID != string.Empty && !lookUp.ContainsKey(_ID))
|
||||
lookUp.Add(_ID, this);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgPartInheritance : SvgPart
|
||||
{
|
||||
#region InheritedSettings
|
||||
internal SvgInheritedSettings _MyInheritedSettings = new SvgInheritedSettings();
|
||||
[XmlIgnore()]
|
||||
internal SvgInheritedSettings MyInheritedSettings
|
||||
{
|
||||
get { return _MyInheritedSettings; }
|
||||
set { _MyInheritedSettings = value; }
|
||||
}
|
||||
#region Line Settings
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("stroke")]
|
||||
public string Stroke
|
||||
{
|
||||
get { return _MyInheritedSettings.Stroke; }
|
||||
set { _MyInheritedSettings.Stroke = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("stroke-width")]
|
||||
public string StrokeWidth
|
||||
{
|
||||
get { return _MyInheritedSettings.StrokeWidth; }
|
||||
set { _MyInheritedSettings.StrokeWidth = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Fill Settings
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("fill")]
|
||||
public string Fill
|
||||
{
|
||||
get { return _MyInheritedSettings.Fill; }
|
||||
set { _MyInheritedSettings.Fill = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Font Settings
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-family")]
|
||||
public string FontFamily
|
||||
{
|
||||
get { return _MyInheritedSettings.FontFamily; }
|
||||
set { _MyInheritedSettings.FontFamily = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-size")]
|
||||
public string FontSize
|
||||
{
|
||||
get { return _MyInheritedSettings.FontSize; }
|
||||
set { _MyInheritedSettings.FontSize = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-style")]
|
||||
public string SVGFontStyle
|
||||
{
|
||||
get { return _MyInheritedSettings.SVGFontStyle; }
|
||||
set { _MyInheritedSettings.SVGFontStyle = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-weight")]
|
||||
public string FontWeight
|
||||
{
|
||||
get { return _MyInheritedSettings.FontWeight; }
|
||||
set { _MyInheritedSettings.FontWeight = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("text-decoration")]
|
||||
public string TextDecoration
|
||||
{
|
||||
get { return _MyInheritedSettings.TextDecoration; }
|
||||
set { _MyInheritedSettings.TextDecoration = value; }
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
#region Setup Inheritance
|
||||
override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
|
||||
{
|
||||
_MyInheritedSettings.MyParentsSettings = myParentsSettings;
|
||||
//_SvgParts.SetupInheritance(_MyInheritedSettings);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,394 +0,0 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
using System.Text;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// A collection that stores <see cref='SVGPart'/> objects.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <seealso cref='SVGPart'/>
|
||||
[Serializable()]
|
||||
[TypeConverter(typeof(SVGPartsConverter))]
|
||||
public partial class SvgParts : CollectionBase, ICustomTypeDescriptor
|
||||
{
|
||||
/// <summary>Notifies when the collection has been modified.</summary>
|
||||
public event EventHandler OnItemsChanged;
|
||||
|
||||
/// <summary>Notifies that an item has been added.</summary>
|
||||
public event SVGPartHandler OnItemAdd;
|
||||
|
||||
/// <summary>Notifies that items have been added.</summary>
|
||||
public event SVGPartHandler OnItemsAdd;
|
||||
|
||||
/// <summary>Notifies that an item has been removed.</summary>
|
||||
public event SVGPartHandler OnItemRemove;
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Initializes a new instance of <see cref='SVGPart'/>.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
public SvgParts()
|
||||
{
|
||||
}
|
||||
|
||||
/// <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>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)
|
||||
{
|
||||
foreach (SvgPart svgPart in List)
|
||||
svgPart.AddLookup(lookUp);
|
||||
}
|
||||
#endregion
|
||||
internal static void ShowException(Exception ex)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string sep = "";
|
||||
for (Exception ex1 = ex; ex1 != null; ex1 = ex1.InnerException)
|
||||
{
|
||||
sb.Append(sep + string.Format("ShowException {0} - {1}", ex1.GetType().Name, ex1.Message));
|
||||
sep = "\r\n";
|
||||
}
|
||||
Console.WriteLine(sb);
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>Adds a <see cref='SVGPart'/> with the specified value to the
|
||||
/// <see cref='SVGPart'/> .</para>
|
||||
/// </summary>
|
||||
/// <param name='value'>The <see cref='SVGPart'/> to add.</param>
|
||||
/// <returns>
|
||||
/// <para>The index at which the new element was inserted.</para>
|
||||
/// </returns>
|
||||
/// <seealso cref='SVGParts.AddRange'/>
|
||||
public int Add(SvgPart value)
|
||||
{
|
||||
int ndx = List.Add(value);
|
||||
if (OnItemAdd != null) { OnItemAdd(this, new SVGPartArgs(value)); }
|
||||
if (OnItemsChanged != null) { OnItemsChanged(value, EventArgs.Empty); }
|
||||
return ndx;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Copies the elements of an array to the end of the <see cref='SVGPart'/>.</para>
|
||||
/// </summary>
|
||||
/// <param name='value'>
|
||||
/// An array of type <see cref='SVGPart'/> containing the objects to add to the collection.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// <para>None.</para>
|
||||
/// </returns>
|
||||
/// <seealso cref='SVGParts.Add'/>
|
||||
public void AddRange(SvgPart[] value)
|
||||
{
|
||||
for (int i = 0; i < value.Length; i++)
|
||||
{
|
||||
this.Add(value[i]);
|
||||
}
|
||||
if (OnItemsAdd != null) { OnItemsAdd(this, new SVGPartArgs(value)); }
|
||||
if (OnItemsChanged != null) { OnItemsChanged(value, EventArgs.Empty); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>
|
||||
/// Adds the contents of another <see cref='SVGPart'/> to the end of the collection.
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name='value'>
|
||||
/// A <see cref='SVGPart'/> containing the objects to add to the collection.
|
||||
/// </param>
|
||||
/// <returns>
|
||||
/// <para>None.</para>
|
||||
/// </returns>
|
||||
/// <seealso cref='SVGParts.Add'/>
|
||||
public void AddRange(SvgParts value)
|
||||
{
|
||||
for (int i = 0; i < value.Count; i++)
|
||||
{
|
||||
this.Add(value[i]);
|
||||
}
|
||||
if (OnItemsAdd != null) { OnItemsAdd(this, new SVGPartArgs(value)); }
|
||||
if (OnItemsChanged != null) { OnItemsChanged(value, EventArgs.Empty); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Gets a value indicating whether the
|
||||
/// <see cref='SVGPart'/> contains the specified <see cref='SVGPart'/>.</para>
|
||||
/// </summary>
|
||||
/// <param name='value'>The <see cref='SVGPart'/> to locate.</param>
|
||||
/// <returns>
|
||||
/// <para><see langword='true'/> if the <see cref='SVGPart'/> is contained in the collection;
|
||||
/// otherwise, <see langword='false'/>.</para>
|
||||
/// </returns>
|
||||
/// <seealso cref='SVGParts.IndexOf'/>
|
||||
public bool Contains(SvgPart value)
|
||||
{
|
||||
return List.Contains(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>Copies the <see cref='SVGPart'/> values to a one-dimensional <see cref='System.Array'/> instance at the
|
||||
/// specified index.</para>
|
||||
/// </summary>
|
||||
/// <param name='array'><para>The one-dimensional <see cref='System.Array'/> that is the destination of the values copied from <see cref='SVGPart'/> .</para></param>
|
||||
/// <param name='index'>The index in <paramref name='array'/> where copying begins.</param>
|
||||
/// <returns>
|
||||
/// <para>None.</para>
|
||||
/// </returns>
|
||||
/// <exception cref='System.ArgumentException'><para><paramref name='array'/> is multidimensional.</para> <para>-or-</para> <para>The number of elements in the <see cref='SVGPart'/> is greater than the available space between <paramref name='arrayIndex'/> and the end of <paramref name='array'/>.</para></exception>
|
||||
/// <exception cref='System.ArgumentNullException'><paramref name='array'/> is <see langword='null'/>. </exception>
|
||||
/// <exception cref='System.ArgumentOutOfRangeException'><paramref name='arrayIndex'/> is less than <paramref name='array'/>'s lowbound. </exception>
|
||||
/// <seealso cref='System.Array'/>
|
||||
public void CopyTo(SvgPart[] array, int index)
|
||||
{
|
||||
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>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)); }
|
||||
if (OnItemsChanged != null) { OnItemsChanged(value, EventArgs.Empty); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para> Removes a specific <see cref='SVGPart'/> from the
|
||||
/// <see cref='SVGParts'/> .</para>
|
||||
/// </summary>
|
||||
/// <param name='value'>The <see cref='SVGPart'/> to remove from the <see cref='SVGParts'/> .</param>
|
||||
/// <returns><para>None.</para></returns>
|
||||
/// <exception cref='System.ArgumentException'><paramref name='value'/> is not found in the Collection. </exception>
|
||||
public void Remove(SvgPart value)
|
||||
{
|
||||
List.Remove(value);
|
||||
if (OnItemRemove != null) { OnItemRemove(this, new SVGPartArgs(value)); }
|
||||
if (OnItemsChanged != null) { OnItemsChanged(value, EventArgs.Empty); }
|
||||
}
|
||||
#region ICustomTypeDescriptor impl
|
||||
public String GetClassName()
|
||||
{ return TypeDescriptor.GetClassName(this, true); }
|
||||
public AttributeCollection GetAttributes()
|
||||
{ return TypeDescriptor.GetAttributes(this, true); }
|
||||
public String GetComponentName()
|
||||
{ return TypeDescriptor.GetComponentName(this, true); }
|
||||
public TypeConverter GetConverter()
|
||||
{ return TypeDescriptor.GetConverter(this, true); }
|
||||
public EventDescriptor GetDefaultEvent()
|
||||
{ return TypeDescriptor.GetDefaultEvent(this, true); }
|
||||
public PropertyDescriptor GetDefaultProperty()
|
||||
{ return TypeDescriptor.GetDefaultProperty(this, true); }
|
||||
public object GetEditor(Type editorBaseType)
|
||||
{ return TypeDescriptor.GetEditor(this, editorBaseType, true); }
|
||||
public EventDescriptorCollection GetEvents(Attribute[] attributes)
|
||||
{ return TypeDescriptor.GetEvents(this, attributes, true); }
|
||||
public EventDescriptorCollection GetEvents()
|
||||
{ return TypeDescriptor.GetEvents(this, true); }
|
||||
public object GetPropertyOwner(PropertyDescriptor pd)
|
||||
{ return this; }
|
||||
/// <summary>
|
||||
/// Called to get the properties of this type. Returns properties with certain
|
||||
/// attributes. this restriction is not implemented here.
|
||||
/// </summary>
|
||||
/// <param name="attributes"></param>
|
||||
/// <returns></returns>
|
||||
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
|
||||
{ return GetProperties(); }
|
||||
/// <summary>
|
||||
/// Called to get the properties of this type.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PropertyDescriptorCollection GetProperties()
|
||||
{
|
||||
// Create a collection object to hold property descriptors
|
||||
PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
|
||||
// Iterate the list
|
||||
for (int i = 0; i < this.Count; i++)
|
||||
{
|
||||
// Create a property descriptor for the item and add to the property descriptor collection
|
||||
SvgPartsPropertyDescriptor pd = new SvgPartsPropertyDescriptor(this, i);
|
||||
pds.Add(pd);
|
||||
}
|
||||
// return the property descriptor collection
|
||||
return pds;
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// Event arguments for the SVGParts collection class.
|
||||
public class SVGPartArgs : EventArgs
|
||||
{
|
||||
private SvgParts t;
|
||||
|
||||
/// Default constructor.
|
||||
public SVGPartArgs()
|
||||
{
|
||||
t = new SvgParts();
|
||||
}
|
||||
|
||||
/// Initializes with a SVGPart.
|
||||
/// Data object.
|
||||
public SVGPartArgs(SvgPart t)
|
||||
: this()
|
||||
{
|
||||
this.t.Add(t);
|
||||
}
|
||||
|
||||
/// Initializes with a collection of SVGPart objects.
|
||||
/// Collection of data.
|
||||
public SVGPartArgs(SvgParts ts)
|
||||
: this()
|
||||
{
|
||||
this.t.AddRange(ts);
|
||||
}
|
||||
|
||||
/// Initializes with an array of SVGPart objects.
|
||||
/// Array of data.
|
||||
public SVGPartArgs(SvgPart[] ts)
|
||||
: this()
|
||||
{
|
||||
this.t.AddRange(ts);
|
||||
}
|
||||
|
||||
/// Gets or sets the data of this argument.
|
||||
public SvgParts SVGParts
|
||||
{
|
||||
get { return t; }
|
||||
set { t = value; }
|
||||
}
|
||||
}
|
||||
|
||||
/// SVGParts event handler.
|
||||
public delegate void SVGPartHandler(object sender, SVGPartArgs e);
|
||||
#region Property Descriptor
|
||||
/// <summary>
|
||||
/// Summary description for CollectionPropertyDescriptor.
|
||||
/// </summary>
|
||||
public partial class SvgPartsPropertyDescriptor : vlnListPropertyDescriptor
|
||||
{
|
||||
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; } }
|
||||
}
|
||||
#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 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(); } }
|
||||
|
||||
} // Class
|
||||
#region Converter
|
||||
internal class SVGPartsConverter : ExpandableObjectConverter
|
||||
{
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
|
||||
{
|
||||
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 base.ConvertTo(context, culture, value, destType);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgRectangle : SvgShapePart
|
||||
{
|
||||
#region ctor
|
||||
public SvgRectangle() { ;}
|
||||
public SvgRectangle(PointF location, SizeF size, Color fillColor, Color lineColor, float lineWidth)
|
||||
{
|
||||
_X.Value = location.X;
|
||||
_Y.Value = location.Y;
|
||||
_Width.Value = size.Width;
|
||||
_Height.Value = size.Height;
|
||||
FillColor = fillColor;
|
||||
LineColor = lineColor;
|
||||
LineWidth = new SvgMeasurement(lineWidth);
|
||||
}
|
||||
//XMLElementAttribute(ElementName = "PREFIX", IsNullable = false)
|
||||
#endregion
|
||||
#region Description
|
||||
private string _Description = string.Empty;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlElement("desc")]
|
||||
public string Description
|
||||
{
|
||||
get { return _Description; }
|
||||
set { _Description = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgMeasurement _X = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement X
|
||||
{
|
||||
get { return _X; }
|
||||
set { _X = value; }
|
||||
}
|
||||
[XmlAttribute("x")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_X); }
|
||||
set { _X = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Y = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Y
|
||||
{
|
||||
get { return _Y; }
|
||||
set { _Y = value; }
|
||||
}
|
||||
[XmlAttribute("y")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Y_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Y); }
|
||||
set { _Y = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Size
|
||||
private SvgMeasurement _Width = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Width
|
||||
{
|
||||
get { return _Width; }
|
||||
set { _Width = value; }
|
||||
}
|
||||
[XmlAttribute("width")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Width_WidthmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Width); }
|
||||
set { _Width = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Height = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Height
|
||||
{
|
||||
get { return _Height; }
|
||||
set { _Height = value; }
|
||||
}
|
||||
[XmlAttribute("height")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Height_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Height); }
|
||||
set { _Height = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,126 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public class SvgScale
|
||||
{
|
||||
private float _XLowerLimit;
|
||||
public float XLowerLimit
|
||||
{
|
||||
get { return _XLowerLimit; }
|
||||
set { _XLowerLimit = value; }
|
||||
}
|
||||
private float _YLowerLimit;
|
||||
public float YLowerLimit
|
||||
{
|
||||
get { return _YLowerLimit; }
|
||||
set { _YLowerLimit = value; }
|
||||
}
|
||||
private float _Scale; // Scale from Logical to Physical
|
||||
public float Scale
|
||||
{ get { return _Scale; } }
|
||||
private float _Width; // Physical Width
|
||||
public float Width
|
||||
{ get { return _Width; } }
|
||||
private float _Height; // Physical Height
|
||||
public float Height
|
||||
{ get { return _Height; } }
|
||||
public float XUpperLimit
|
||||
{ get { return _Width * _Scale + _XLowerLimit; } }
|
||||
public float YUpperLimit
|
||||
{ get { return _Height * _Scale + _YLowerLimit; } }
|
||||
private float _DPI;
|
||||
public float DPI
|
||||
{ get { return _DPI; } }
|
||||
private SvgScale(SvgScale tmp,SvgMeasurement newX, SvgMeasurement newY)
|
||||
{
|
||||
_DPI = tmp.DPI;
|
||||
_Scale = tmp.Scale;
|
||||
_Width = tmp.Width;
|
||||
_Height = tmp.Height;
|
||||
_XLowerLimit = tmp.XLowerLimit - newX.GetSizeInPixels(DPI);
|
||||
_YLowerLimit = tmp.YLowerLimit - newY.GetSizeInPixels(DPI);
|
||||
}
|
||||
public SvgScale(float myDPI, RectangleF bounds,SvgMeasurement width, SvgMeasurement height, SvgViewBox myViewBox)
|
||||
{
|
||||
// TODO: Should I convert to pixels or something fixed (Inches, Points, Picas, CMs, MMs, Twips)
|
||||
_DPI = myDPI;
|
||||
float outputWidth = width.GetSizeInPixels(100);
|
||||
if(outputWidth == 0) outputWidth = bounds.Width;
|
||||
float outputHeight = height.GetSizeInPixels(100);
|
||||
if (outputHeight == 0) outputHeight = bounds.Height;
|
||||
float inputWidth = myViewBox.Width;
|
||||
if (inputWidth == 0) inputWidth = outputWidth;
|
||||
float scalex = outputWidth / inputWidth;
|
||||
float inputHeight = myViewBox.Height;
|
||||
if (inputHeight == 0) inputHeight = outputHeight;
|
||||
float scaley = outputHeight / inputHeight;
|
||||
_Scale = (scalex < scaley) ? scaley : scalex;
|
||||
//Console.WriteLine("'Scale',{0}",_Scale);
|
||||
_Width = outputWidth / _Scale;
|
||||
_Height = outputHeight / _Scale;
|
||||
_XLowerLimit = myViewBox.X + (inputWidth - _Width) / 2;
|
||||
_YLowerLimit = myViewBox.Y + (inputHeight - _Height) / 2;
|
||||
//if (myDPI != 96) Console.WriteLine("DPI {0}", myDPI);
|
||||
//Console.WriteLine("Scale,{0},{1},{2},{3},{4},{5},{6}", Scale, Width, Height, XLowerLimit, XUpperLimit, YLowerLimit, YUpperLimit);
|
||||
}
|
||||
public SvgScale AdjustOrigin(SvgMeasurement newX, SvgMeasurement newY)
|
||||
{
|
||||
return new SvgScale(this, newX, newY);
|
||||
}
|
||||
public float X(float x)
|
||||
{
|
||||
return _Scale * (x - XLowerLimit);
|
||||
}
|
||||
public float Y(float y)
|
||||
{
|
||||
return _Scale * (y - YLowerLimit);
|
||||
}
|
||||
public float AbsX(SvgMeasurement x)
|
||||
{
|
||||
return x.GetSizeInPixels(DPI) + Svg.AbsoluteOffset.X;
|
||||
}
|
||||
public float AbsY(iTextSharp.text.pdf.PdfContentByte cb, SvgMeasurement y)
|
||||
{
|
||||
// the following line of code is 'taken' from the 16bit code: \promsnt\exe\wined\togdi.cpp
|
||||
// whenever doing an 'Absolute' macro.
|
||||
float yOffset = 54 * 4.8f + 0.5f; // yOffset starts in 'twips' (twip = 1/20 point)
|
||||
yOffset = yOffset / 20; // convert from twips to points (point = 1/72 inch)
|
||||
return cb.PdfDocument.PageSize.Height - y.GetSizeInPixels(DPI) + yOffset + Svg.AbsoluteOffset.Y;
|
||||
}
|
||||
public float Y(iTextSharp.text.pdf.PdfContentByte cb, float y)
|
||||
{
|
||||
return cb.PdfDocument.PageSize.Height - _Scale * (y - YLowerLimit);
|
||||
}
|
||||
public float M(float m)
|
||||
{
|
||||
return _Scale * m;
|
||||
}
|
||||
public float X(SvgMeasurement x)
|
||||
{
|
||||
float retval = _Scale * (x.GetSizeInPixels(DPI) - XLowerLimit);
|
||||
return retval;
|
||||
}
|
||||
public float Y(SvgMeasurement y)
|
||||
{
|
||||
return _Scale * (y.GetSizeInPixels(DPI) - YLowerLimit);
|
||||
}
|
||||
public float Y(iTextSharp.text.pdf.PdfContentByte cb, SvgMeasurement y)
|
||||
{
|
||||
float yOffset = 0; // = (cb.PdfWriter.CurrentPageNumber -1) * .8F * cb.PdfDocument.PageSize.Height;
|
||||
float myY = yOffset + cb.PdfDocument.PageSize.Height - _Scale * (y.GetSizeInPixels(DPI) - YLowerLimit);
|
||||
return myY;
|
||||
}
|
||||
public float YY(SvgMeasurement y)
|
||||
{
|
||||
return -_Scale * y.GetSizeInPixels(DPI);
|
||||
}
|
||||
public float M(SvgMeasurement m)
|
||||
{
|
||||
return _Scale * m.GetSizeInPixels(DPI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.IO;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public static class SvgSerializer<T> where T : class
|
||||
{
|
||||
public static string StringSerialize(T t)
|
||||
{
|
||||
string strOutput = string.Empty;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T),"http://www.w3.org/2000/svg");
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
xs.Serialize( new NonXsiTextWriter(ms,Encoding.UTF8), t);
|
||||
//xs.Serialize(ms, t);
|
||||
ms.Position = 0;
|
||||
StreamReader sr = new StreamReader(ms);
|
||||
strOutput = sr.ReadToEnd();
|
||||
ms.Close();
|
||||
}
|
||||
return strOutput;
|
||||
}
|
||||
public static T StringDeserialize(string s)
|
||||
{
|
||||
T t;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.w3.org/2000/svg");
|
||||
UTF8Encoding enc = new UTF8Encoding();
|
||||
Byte[] arrBytData = enc.GetBytes(s);
|
||||
using (MemoryStream ms = new MemoryStream(arrBytData))
|
||||
{
|
||||
t = (T)xs.Deserialize(ms);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
public static void WriteFile(T t, string fileName)
|
||||
{
|
||||
string strOutput = string.Empty;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.w3.org/2000/svg");
|
||||
using (FileStream fs = new FileStream(fileName, FileMode.Create))
|
||||
{
|
||||
xs.Serialize(new NonXsiTextWriter(fs,Encoding.UTF8), t);
|
||||
fs.Close();
|
||||
}
|
||||
}
|
||||
public static T ReadFile(string fileName)
|
||||
{
|
||||
T t;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(T), "http://www.w3.org/2000/svg");
|
||||
using (FileStream fs = new FileStream(fileName, FileMode.Open))
|
||||
{
|
||||
t = (T)xs.Deserialize(fs);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
}
|
||||
public class NonXsiTextWriter : XmlTextWriter
|
||||
{
|
||||
public NonXsiTextWriter( TextWriter w ) : base( w ) {}
|
||||
public NonXsiTextWriter( Stream w, Encoding encoding ) : base( w, encoding ) {
|
||||
this.Formatting = Formatting.Indented;
|
||||
}
|
||||
public NonXsiTextWriter( string filename, Encoding encoding ) : base( filename, encoding ) {}
|
||||
bool _skip = false;
|
||||
public override void WriteStartAttribute( string prefix, string localName, string ns )
|
||||
{
|
||||
if ((prefix == "xmlns" && (localName == "xsd" || localName == "xsi")) || // Omits XSD and XSI declarations.
|
||||
ns == XmlSchema.InstanceNamespace ) // Omits all XSI attributes.
|
||||
{
|
||||
_skip = true;
|
||||
return;
|
||||
}
|
||||
if(localName == "xlink_href")
|
||||
base.WriteStartAttribute(prefix, "xlink:href", ns);
|
||||
else
|
||||
base.WriteStartAttribute( prefix, localName, ns );
|
||||
}
|
||||
public override void WriteString( string text ) {
|
||||
if ( _skip ) return;
|
||||
base.WriteString( text );
|
||||
}
|
||||
public override void WriteEndAttribute()
|
||||
{
|
||||
if ( _skip )
|
||||
{ // Reset the flag, so we keep writing.
|
||||
_skip = false;
|
||||
return;
|
||||
}
|
||||
base.WriteEndAttribute();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public abstract class SvgShapePart : SvgLinePart
|
||||
{
|
||||
#region Fill Settings
|
||||
protected SvgFillSettings _MyFillSettings = new SvgFillSettings();
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("fill")]
|
||||
public string Fill
|
||||
{
|
||||
get { return _MyFillSettings.Fill; }
|
||||
set { _MyFillSettings.Fill = value; }
|
||||
}
|
||||
[XmlIgnore]
|
||||
public Color FillColor
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyFillSettings.Fill.ToUpper() == "NONE") return _MyFillSettings.FillColor;
|
||||
return Svg.OverrideColor != System.Drawing.Color.Empty ? Svg.OverrideColor : _MyFillSettings.FillColor;
|
||||
}
|
||||
|
||||
set { _MyFillSettings.FillColor = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Setup Inheritance
|
||||
override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
|
||||
{
|
||||
base.SetupInheritance(myParentsSettings);
|
||||
_MyFillSettings.MyParentsSettings = myParentsSettings.MyFillSettings;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
[XmlRoot("svg-test")]
|
||||
public class SvgTest
|
||||
{
|
||||
public SvgTest()
|
||||
{
|
||||
_MyLineSettings = new SvgLineSettings(Color.Red,new SvgMeasurement(3, E_MeasurementUnits.PX));
|
||||
_MyFillSettings = new SvgFillSettings(Color.Cyan);
|
||||
_MyFontSettings = new SvgFontSettings(new Font("Cambria", 20, FontStyle.Bold | FontStyle.Italic | FontStyle.Underline, GraphicsUnit.Point));
|
||||
}
|
||||
#region Line Settings
|
||||
private SvgLineSettings _MyLineSettings;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("stroke")]
|
||||
public string Stroke
|
||||
{
|
||||
get { return _MyLineSettings.Stroke; }
|
||||
set { _MyLineSettings.Stroke = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("stroke-width")]
|
||||
public string StrokeWidth
|
||||
{
|
||||
get { return _MyLineSettings.StrokeWidth; }
|
||||
set { _MyLineSettings.StrokeWidth = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Fill Settings
|
||||
private SvgFillSettings _MyFillSettings;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("fill")]
|
||||
public string Fill
|
||||
{
|
||||
get { return _MyFillSettings.Fill; }
|
||||
set { _MyFillSettings.Fill = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Font Settings
|
||||
private SvgFontSettings _MyFontSettings;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-family")]
|
||||
public string FontFamily
|
||||
{
|
||||
get { return _MyFontSettings.FontFamily; }
|
||||
set { _MyFontSettings.FontFamily = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-size")]
|
||||
public string FontSize
|
||||
{
|
||||
get { return _MyFontSettings.FontSize; }
|
||||
set { _MyFontSettings.FontSize = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-style")]
|
||||
public string SVGFontStyle
|
||||
{
|
||||
get { return _MyFontSettings.SVGFontStyle; }
|
||||
set { _MyFontSettings.SVGFontStyle = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-weight")]
|
||||
public string FontWeight
|
||||
{
|
||||
get { return _MyFontSettings.FontWeight; }
|
||||
set { _MyFontSettings.FontWeight = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("text-decoration")]
|
||||
public string TextDecoration
|
||||
{
|
||||
get { return _MyFontSettings.TextDecoration; }
|
||||
set { _MyFontSettings.TextDecoration = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,156 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgText : SvgShapePart
|
||||
{
|
||||
#region ctor
|
||||
public SvgText() { ;}
|
||||
public SvgText(PointF location, string text, Font font, Color fillColor)
|
||||
{
|
||||
_X.Value = location.X;
|
||||
_Y.Value = location.Y;
|
||||
Text = text;
|
||||
Font = font;
|
||||
FillColor = fillColor;
|
||||
LineColor = Color.Empty;
|
||||
LineWidth = new SvgMeasurement(0);
|
||||
}
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgJustify _Justify = SvgJustify.Left;
|
||||
[XmlAttribute("Justify")]
|
||||
public SvgJustify Justify
|
||||
{
|
||||
get { return _Justify; }
|
||||
set { _Justify = value; }
|
||||
}
|
||||
private SvgMeasurement _X = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement X
|
||||
{
|
||||
get { return _X; }
|
||||
set { _X = value; }
|
||||
}
|
||||
[XmlAttribute("x")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_X); }
|
||||
set { _X = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Y = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Y
|
||||
{
|
||||
get { return _Y; }
|
||||
set { _Y = value; }
|
||||
}
|
||||
[XmlAttribute("y")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Y_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Y); }
|
||||
set { _Y = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Text
|
||||
private string _Text;
|
||||
[XmlText()]
|
||||
public string Text
|
||||
{
|
||||
get { return _Text; }
|
||||
set { _Text = value.Replace("{sp}"," "); }
|
||||
}
|
||||
#endregion
|
||||
#region Font Settings
|
||||
private SvgFontSettings _MyFontSettings = new SvgFontSettings();
|
||||
[XmlIgnore]
|
||||
public Font Font
|
||||
{
|
||||
get
|
||||
{
|
||||
//if (_MyFontSettings.Font.Size < 10)
|
||||
// Console.WriteLine("It didn't work!");
|
||||
return _MyFontSettings.Font;
|
||||
}
|
||||
set
|
||||
{
|
||||
//if (value.Size < 10)
|
||||
// Console.WriteLine("It didn't work!");
|
||||
_MyFontSettings.Font = value;
|
||||
}
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-family")]
|
||||
public string FontFamily
|
||||
{
|
||||
get { return _MyFontSettings.FontFamily; }
|
||||
set { _MyFontSettings.FontFamily = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-size")]
|
||||
public string FontSize
|
||||
{
|
||||
get { return _MyFontSettings.FontSize; }
|
||||
set { _MyFontSettings.FontSize = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-style")]
|
||||
public string SVGFontStyle
|
||||
{
|
||||
get { return _MyFontSettings.SVGFontStyle; }
|
||||
set { _MyFontSettings.SVGFontStyle = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("font-weight")]
|
||||
public string FontWeight
|
||||
{
|
||||
get { return _MyFontSettings.FontWeight; }
|
||||
set { _MyFontSettings.FontWeight = value; }
|
||||
}
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlAttribute("text-decoration")]
|
||||
public string TextDecoration
|
||||
{
|
||||
get { return _MyFontSettings.TextDecoration; }
|
||||
set { _MyFontSettings.TextDecoration = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Description
|
||||
private string _Description = string.Empty;
|
||||
[System.ComponentModel.DefaultValueAttribute("")]
|
||||
[XmlElement("desc")]
|
||||
public string Description
|
||||
{
|
||||
get { return _Description; }
|
||||
set { _Description = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Setup Inheritance
|
||||
override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
|
||||
{
|
||||
base.SetupInheritance(myParentsSettings);
|
||||
_MyFontSettings.MyParentsSettings = myParentsSettings.MyFontSettings;
|
||||
}
|
||||
#endregion
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("({0}, {1}) - '{2}'",this.X,this.Y,this.Text);
|
||||
}
|
||||
}
|
||||
public enum SvgJustify
|
||||
{
|
||||
Left = 0,
|
||||
Center = 1,
|
||||
Right =2
|
||||
}
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.ComponentModel;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public partial class SvgUse : SvgPartInheritance
|
||||
{
|
||||
#region ctor
|
||||
public SvgUse() { ;}
|
||||
public SvgUse(PointF location, SizeF size, string id)
|
||||
{
|
||||
_X.Value = location.X;
|
||||
_Y.Value = location.Y;
|
||||
_Width.Value = size.Width;
|
||||
_Height.Value = size.Height;
|
||||
_ID = id;
|
||||
}
|
||||
#endregion
|
||||
#region Location
|
||||
private SvgMeasurement _X = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement X
|
||||
{
|
||||
get { return _X; }
|
||||
set { _X = value; }
|
||||
}
|
||||
[XmlAttribute("x")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string X_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_X); }
|
||||
set { _X = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Y = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Y
|
||||
{
|
||||
get { return _Y; }
|
||||
set { _Y = value; }
|
||||
}
|
||||
[XmlAttribute("y")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Y_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Y); }
|
||||
set { _Y = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region Size
|
||||
private SvgMeasurement _Width = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Width
|
||||
{
|
||||
get { return _Width; }
|
||||
set { _Width = value; }
|
||||
}
|
||||
[XmlAttribute("width")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Width_WidthmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Width); }
|
||||
set { _Width = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
private SvgMeasurement _Height = new SvgMeasurement();
|
||||
[XmlIgnore]
|
||||
public SvgMeasurement Height
|
||||
{
|
||||
get { return _Height; }
|
||||
set { _Height = value; }
|
||||
}
|
||||
[XmlAttribute("height")]
|
||||
[Browsable(false)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public string Height_XmlSurrogate
|
||||
{
|
||||
get { return SvgXmlConverter<SvgMeasurement>.GetString(_Height); }
|
||||
set { _Height = SvgXmlConverter<SvgMeasurement>.GetObject(value); }
|
||||
}
|
||||
#endregion
|
||||
#region ID to be used
|
||||
private string _UseID = null;
|
||||
[XmlAttribute(AttributeName = "href", Namespace = "http://www.w3.org/1999/xlink")]
|
||||
public string UseID
|
||||
{
|
||||
get { return _UseID; }
|
||||
set { _UseID = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Setup Inheritance
|
||||
override internal void SetupInheritance(SvgInheritedSettings myParentsSettings)
|
||||
{
|
||||
_MyInheritedSettings.MyParentsSettings = myParentsSettings;
|
||||
}
|
||||
#endregion
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("({0}, {1}) Template '{2}'", this.X, this.Y, this.UseID);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
[TypeConverter(typeof(ViewBoxTypeConverter))]
|
||||
public class SvgViewBox
|
||||
{
|
||||
#region ctor
|
||||
public SvgViewBox() { ;}
|
||||
public SvgViewBox(float x, float y, float width, float height)
|
||||
{
|
||||
_MyRectangleF = new RectangleF(x, y, width, height);
|
||||
}
|
||||
public SvgViewBox(string val)
|
||||
{
|
||||
string[] parms = ((string)val).Split(' ');
|
||||
_MyRectangleF = new RectangleF(Convert.ToSingle(parms[0]), Convert.ToSingle(parms[1]), Convert.ToSingle(parms[2]), Convert.ToSingle(parms[3]));
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
private RectangleF _MyRectangleF = new RectangleF();
|
||||
public float X
|
||||
{
|
||||
get { return _MyRectangleF.X; }
|
||||
set { _MyRectangleF.X = value; }
|
||||
}
|
||||
public float Y
|
||||
{
|
||||
get { return _MyRectangleF.Y; }
|
||||
set { _MyRectangleF.Y = value; }
|
||||
}
|
||||
public float Width
|
||||
{
|
||||
get { return _MyRectangleF.Width; }
|
||||
set { _MyRectangleF.Width = value; }
|
||||
}
|
||||
public float Height
|
||||
{
|
||||
get { return _MyRectangleF.Height; }
|
||||
set { _MyRectangleF.Height = value; }
|
||||
}
|
||||
#endregion
|
||||
#region ToString
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("{0} {1} {2} {3}", X, Y, Width, Height);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class ViewBoxTypeConverter : ExpandableObjectConverter
|
||||
{
|
||||
public override bool CanConvertTo(ITypeDescriptorContext context, Type t)
|
||||
{
|
||||
return t == typeof(String);
|
||||
}
|
||||
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
|
||||
{
|
||||
if (destType == typeof(string) && value is SvgViewBox)
|
||||
{
|
||||
return value.ToString();
|
||||
}
|
||||
return base.ConvertTo(context, culture, value, destType);
|
||||
}
|
||||
public override bool CanConvertFrom(ITypeDescriptorContext context, Type t)
|
||||
{
|
||||
return t == typeof(String);
|
||||
}
|
||||
public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object val)
|
||||
{
|
||||
string[] parms = ((string)val).Split(' ');
|
||||
SvgViewBox viewBox = new SvgViewBox(Convert.ToSingle(parms[0]), Convert.ToSingle(parms[1]), Convert.ToSingle(parms[2]), Convert.ToSingle(parms[3]));
|
||||
return viewBox;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Volian.Svg.Library
|
||||
{
|
||||
public static class SvgXmlConverter<T> where T : class
|
||||
{
|
||||
public static string GetString(T myObject)
|
||||
{
|
||||
if (myObject == null) return null;
|
||||
TypeConverter FontConverter = TypeDescriptor.GetConverter(typeof(T));
|
||||
return FontConverter.ConvertToInvariantString(myObject);
|
||||
}
|
||||
public static T GetObject(string value)
|
||||
{
|
||||
TypeConverter converter = TypeDescriptor.GetConverter(typeof(T));
|
||||
return (T)converter.ConvertFromInvariantString(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{293911B5-C602-483F-A97F-F962EEFB3CAE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Volian.Svg.Library</RootNamespace>
|
||||
<AssemblyName>Volian.Svg.Library</AssemblyName>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Itenso.Rtf.Interpreter">
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Interpreter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Itenso.Rtf.Parser">
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\RtfConverter\bin\Debug\Itenso.Rtf.Parser.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="itextsharp, Version=4.1.2.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\iTechSharp\itextsharp.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\Log4Net\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Drawing.Design" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="FontFind.cs" />
|
||||
<Compile Include="Graphics.cs" />
|
||||
<Compile Include="iTextSharp.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Svg.cs" />
|
||||
<Compile Include="SvgArc.cs" />
|
||||
<Compile Include="SvgCircle.cs" />
|
||||
<Compile Include="SvgDefine.cs" />
|
||||
<Compile Include="SvgEllipse.cs" />
|
||||
<Compile Include="SvgFillSettings.cs" />
|
||||
<Compile Include="SvgFontSettings.cs" />
|
||||
<Compile Include="SvgGroup.cs" />
|
||||
<Compile Include="SvgImage.cs" />
|
||||
<Compile Include="SvgInheritedSettings.cs" />
|
||||
<Compile Include="SvgLine.cs" />
|
||||
<Compile Include="SvgLinePart.cs" />
|
||||
<Compile Include="SvgLineSettings.cs" />
|
||||
<Compile Include="SvgMeasurement.cs" />
|
||||
<Compile Include="SvgPart.cs" />
|
||||
<Compile Include="SvgPartInheritance.cs" />
|
||||
<Compile Include="SvgParts.cs" />
|
||||
<Compile Include="SvgRectangle.cs" />
|
||||
<Compile Include="SvgScale.cs" />
|
||||
<Compile Include="SvgSerializer.cs" />
|
||||
<Compile Include="SvgShapePart.cs" />
|
||||
<Compile Include="SvgTest.cs" />
|
||||
<Compile Include="SvgText.cs" />
|
||||
<Compile Include="SvgUse.cs" />
|
||||
<Compile Include="SvgViewBox.cs" />
|
||||
<Compile Include="SvgXMLConverter.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Volian.Base.Library\Volian.Base.Library.csproj">
|
||||
<Project>{AEEE9FD1-6892-45E2-A67E-418C06D46FF9}</Project>
|
||||
<Name>Volian.Base.Library</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,383 +0,0 @@
|
||||
/*
|
||||
IniReader class for C#
|
||||
Version: 1.0 Date: 2002/04/24
|
||||
*/
|
||||
/*
|
||||
Copyright © 2002, The KPD-Team
|
||||
All rights reserved.
|
||||
http://www.mentalis.org/
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Neither the name of the KPD-Team, nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
||||
THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// The Org.Mentalis.Files contains a number of classes that read from or write to special files.
|
||||
namespace Org.Mentalis.Files {
|
||||
/// <summary>
|
||||
/// The INIReader class can read keys from and write keys to an INI file.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This class uses several Win32 API functions to read from and write to INI files. It will not work on Linux or FreeBSD.
|
||||
/// </remarks>
|
||||
public class IniReader {
|
||||
// API declarations
|
||||
/// <summary>
|
||||
/// The GetPrivateProfileInt function retrieves an integer associated with a key in the specified section of an initialization file.
|
||||
/// </summary>
|
||||
/// <param name="lpApplicationName">Pointer to a null-terminated string specifying the name of the section in the initialization file.</param>
|
||||
/// <param name="lpKeyName">Pointer to the null-terminated string specifying the name of the key whose value is to be retrieved. This value is in the form of a string; the GetPrivateProfileInt function converts the string into an integer and returns the integer.</param>
|
||||
/// <param name="nDefault">Specifies the default value to return if the key name cannot be found in the initialization file.</param>
|
||||
/// <param name="lpFileName">Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.</param>
|
||||
/// <returns>The return value is the integer equivalent of the string following the specified key name in the specified initialization file. If the key is not found, the return value is the specified default value. If the value of the key is less than zero, the return value is zero.</returns>
|
||||
[DllImport("KERNEL32.DLL", EntryPoint="GetPrivateProfileIntA", CharSet=CharSet.Ansi)]
|
||||
private static extern int GetPrivateProfileInt(string lpApplicationName, string lpKeyName, int nDefault, string lpFileName);
|
||||
/// <summary>
|
||||
/// The WritePrivateProfileString function copies a string into the specified section of an initialization file.
|
||||
/// </summary>
|
||||
/// <param name="lpApplicationName">Pointer to a null-terminated string containing the name of the section to which the string will be copied. If the section does not exist, it is created. The name of the section is case-independent; the string can be any combination of uppercase and lowercase letters.</param>
|
||||
/// <param name="lpKeyName">Pointer to the null-terminated string containing the name of the key to be associated with a string. If the key does not exist in the specified section, it is created. If this parameter is NULL, the entire section, including all entries within the section, is deleted.</param>
|
||||
/// <param name="lpString">Pointer to a null-terminated string to be written to the file. If this parameter is NULL, the key pointed to by the lpKeyName parameter is deleted.</param>
|
||||
/// <param name="lpFileName">Pointer to a null-terminated string that specifies the name of the initialization file.</param>
|
||||
/// <returns>If the function successfully copies the string to the initialization file, the return value is nonzero; if the function fails, or if it flushes the cached version of the most recently accessed initialization file, the return value is zero.</returns>
|
||||
[DllImport("KERNEL32.DLL", EntryPoint="WritePrivateProfileStringA", CharSet=CharSet.Ansi)]
|
||||
private static extern int WritePrivateProfileString (string lpApplicationName, string lpKeyName, string lpString, string lpFileName);
|
||||
/// <summary>
|
||||
/// The GetPrivateProfileString function retrieves a string from the specified section in an initialization file.
|
||||
/// </summary>
|
||||
/// <param name="lpApplicationName">Pointer to a null-terminated string that specifies the name of the section containing the key name. If this parameter is NULL, the GetPrivateProfileString function copies all section names in the file to the supplied buffer.</param>
|
||||
/// <param name="lpKeyName">Pointer to the null-terminated string specifying the name of the key whose associated string is to be retrieved. If this parameter is NULL, all key names in the section specified by the lpAppName parameter are copied to the buffer specified by the lpReturnedString parameter.</param>
|
||||
/// <param name="lpDefault">Pointer to a null-terminated default string. If the lpKeyName key cannot be found in the initialization file, GetPrivateProfileString copies the default string to the lpReturnedString buffer. This parameter cannot be NULL. <br>Avoid specifying a default string with trailing blank characters. The function inserts a null character in the lpReturnedString buffer to strip any trailing blanks.</br></param>
|
||||
/// <param name="lpReturnedString">Pointer to the buffer that receives the retrieved string.</param>
|
||||
/// <param name="nSize">Specifies the size, in TCHARs, of the buffer pointed to by the lpReturnedString parameter.</param>
|
||||
/// <param name="lpFileName">Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.</param>
|
||||
/// <returns>The return value is the number of characters copied to the buffer, not including the terminating null character.</returns>
|
||||
[DllImport("KERNEL32.DLL", EntryPoint="GetPrivateProfileStringA", CharSet=CharSet.Ansi)]
|
||||
private static extern int GetPrivateProfileString (string lpApplicationName, string lpKeyName, string lpDefault, StringBuilder lpReturnedString, int nSize, string lpFileName);
|
||||
/// <summary>
|
||||
/// The GetPrivateProfileSectionNames function retrieves the names of all sections in an initialization file.
|
||||
/// </summary>
|
||||
/// <param name="lpszReturnBuffer">Pointer to a buffer that receives the section names associated with the named file. The buffer is filled with one or more null-terminated strings; the last string is followed by a second null character.</param>
|
||||
/// <param name="nSize">Specifies the size, in TCHARs, of the buffer pointed to by the lpszReturnBuffer parameter.</param>
|
||||
/// <param name="lpFileName">Pointer to a null-terminated string that specifies the name of the initialization file. If this parameter is NULL, the function searches the Win.ini file. If this parameter does not contain a full path to the file, the system searches for the file in the Windows directory.</param>
|
||||
/// <returns>The return value specifies the number of characters copied to the specified buffer, not including the terminating null character. If the buffer is not large enough to contain all the section names associated with the specified initialization file, the return value is equal to the length specified by nSize minus two.</returns>
|
||||
[DllImport("KERNEL32.DLL", EntryPoint="GetPrivateProfileSectionNamesA", CharSet=CharSet.Ansi)]
|
||||
private static extern int GetPrivateProfileSectionNames (byte[] lpszReturnBuffer, int nSize, string lpFileName);
|
||||
/// <summary>
|
||||
/// The WritePrivateProfileSection function replaces the keys and values for the specified section in an initialization file.
|
||||
/// </summary>
|
||||
/// <param name="lpAppName">Pointer to a null-terminated string specifying the name of the section in which data is written. This section name is typically the name of the calling application.</param>
|
||||
/// <param name="lpString">Pointer to a buffer containing the new key names and associated values that are to be written to the named section.</param>
|
||||
/// <param name="lpFileName">Pointer to a null-terminated string containing the name of the initialization file. If this parameter does not contain a full path for the file, the function searches the Windows directory for the file. If the file does not exist and lpFileName does not contain a full path, the function creates the file in the Windows directory. The function does not create a file if lpFileName contains the full path and file name of a file that does not exist.</param>
|
||||
/// <returns>If the function succeeds, the return value is nonzero.<br>If the function fails, the return value is zero.</br></returns>
|
||||
[DllImport("KERNEL32.DLL", EntryPoint="WritePrivateProfileSectionA", CharSet=CharSet.Ansi)]
|
||||
private static extern int WritePrivateProfileSection (string lpAppName, string lpString, string lpFileName);
|
||||
/// <summary>Constructs a new IniReader instance.</summary>
|
||||
/// <param name="file">Specifies the full path to the INI file (the file doesn't have to exist).</param>
|
||||
public IniReader(string file) {
|
||||
Filename = file;
|
||||
}
|
||||
/// <summary>Gets or sets the full path to the INI file.</summary>
|
||||
/// <value>A String representing the full path to the INI file.</value>
|
||||
public string Filename {
|
||||
get {
|
||||
return m_Filename;
|
||||
}
|
||||
set {
|
||||
m_Filename = value;
|
||||
}
|
||||
}
|
||||
/// <summary>Gets or sets the section you're working in. (aka 'the active section')</summary>
|
||||
/// <value>A String representing the section you're working in.</value>
|
||||
public string Section {
|
||||
get {
|
||||
return m_Section;
|
||||
}
|
||||
set {
|
||||
m_Section = value;
|
||||
}
|
||||
}
|
||||
/// <summary>Reads an Integer from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The value to return if the specified key isn't found.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public int ReadInteger(string section, string key, int defVal) {
|
||||
return GetPrivateProfileInt(section, key, defVal, Filename);
|
||||
}
|
||||
/// <summary>Reads an Integer from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns 0 if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public int ReadInteger(string section, string key) {
|
||||
return ReadInteger(section, key, 0);
|
||||
}
|
||||
/// <summary>Reads an Integer from the specified key of the active section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The section to search in.</param>
|
||||
/// <returns>Returns the value of the specified Key, or returns the default value if the specified Key isn't found in the active section of the INI file.</returns>
|
||||
public int ReadInteger(string key, int defVal) {
|
||||
return ReadInteger(Section, key, defVal);
|
||||
}
|
||||
/// <summary>Reads an Integer from the specified key of the active section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified key, or returns 0 if the specified key isn't found in the active section of the INI file.</returns>
|
||||
public int ReadInteger(string key) {
|
||||
return ReadInteger(key, 0);
|
||||
}
|
||||
/// <summary>Reads a String from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The value to return if the specified key isn't found.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public string ReadString(string section, string key, string defVal) {
|
||||
StringBuilder sb = new StringBuilder(MAX_ENTRY);
|
||||
int Ret = GetPrivateProfileString(section, key, defVal, sb, MAX_ENTRY, Filename);
|
||||
return sb.ToString();
|
||||
}
|
||||
/// <summary>Reads a String from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns an empty String if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public string ReadString(string section, string key) {
|
||||
return ReadString(section, key, "");
|
||||
}
|
||||
/// <summary>Reads a String from the specified key of the active section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified key, or returns an empty String if the specified key isn't found in the active section of the INI file.</returns>
|
||||
public string ReadString(string key) {
|
||||
return ReadString(Section, key);
|
||||
}
|
||||
/// <summary>Reads a Long from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The value to return if the specified key isn't found.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public long ReadLong(string section, string key, long defVal) {
|
||||
return long.Parse(ReadString(section, key, defVal.ToString()));
|
||||
}
|
||||
/// <summary>Reads a Long from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns 0 if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public long ReadLong(string section, string key) {
|
||||
return ReadLong(section, key, 0);
|
||||
}
|
||||
/// <summary>Reads a Long from the specified key of the active section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The section to search in.</param>
|
||||
/// <returns>Returns the value of the specified key, or returns the default value if the specified key isn't found in the active section of the INI file.</returns>
|
||||
public long ReadLong(string key, long defVal) {
|
||||
return ReadLong(Section, key, defVal);
|
||||
}
|
||||
/// <summary>Reads a Long from the specified key of the active section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified Key, or returns 0 if the specified Key isn't found in the active section of the INI file.</returns>
|
||||
public long ReadLong(string key) {
|
||||
return ReadLong(key, 0);
|
||||
}
|
||||
/// <summary>Reads a Byte array from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns null (Nothing in VB.NET) if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public byte[] ReadByteArray(string section, string key) {
|
||||
try {
|
||||
return Convert.FromBase64String(ReadString(section, key));
|
||||
} catch {}
|
||||
return null;
|
||||
}
|
||||
/// <summary>Reads a Byte array from the specified key of the active section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified key, or returns null (Nothing in VB.NET) if the specified key pair isn't found in the active section of the INI file.</returns>
|
||||
public byte[] ReadByteArray(string key) {
|
||||
return ReadByteArray(Section, key);
|
||||
}
|
||||
/// <summary>Reads a Boolean from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The value to return if the specified key isn't found.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns the default value if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public bool ReadBoolean(string section, string key, bool defVal) {
|
||||
return Boolean.Parse(ReadString(section, key, defVal.ToString()));
|
||||
}
|
||||
/// <summary>Reads a Boolean from the specified key of the specified section.</summary>
|
||||
/// <param name="section">The section to search in.</param>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified section/key pair, or returns false if the specified section/key pair isn't found in the INI file.</returns>
|
||||
public bool ReadBoolean(string section, string key) {
|
||||
return ReadBoolean(section, key, false);
|
||||
}
|
||||
/// <summary>Reads a Boolean from the specified key of the specified section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <param name="defVal">The value to return if the specified key isn't found.</param>
|
||||
/// <returns>Returns the value of the specified key pair, or returns the default value if the specified key isn't found in the active section of the INI file.</returns>
|
||||
public bool ReadBoolean(string key, bool defVal) {
|
||||
return ReadBoolean(Section, key, defVal);
|
||||
}
|
||||
/// <summary>Reads a Boolean from the specified key of the specified section.</summary>
|
||||
/// <param name="key">The key from which to return the value.</param>
|
||||
/// <returns>Returns the value of the specified key, or returns false if the specified key isn't found in the active section of the INI file.</returns>
|
||||
public bool ReadBoolean(string key) {
|
||||
return ReadBoolean(Section, key);
|
||||
}
|
||||
/// <summary>Writes an Integer to the specified key in the specified section.</summary>
|
||||
/// <param name="section">The section to write in.</param>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string section, string key, int value) {
|
||||
return Write(section, key, value.ToString());
|
||||
}
|
||||
/// <summary>Writes an Integer to the specified key in the active section.</summary>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string key, int value) {
|
||||
return Write(Section, key, value);
|
||||
}
|
||||
/// <summary>Writes a String to the specified key in the specified section.</summary>
|
||||
/// <param name="section">Specifies the section to write in.</param>
|
||||
/// <param name="key">Specifies the key to write to.</param>
|
||||
/// <param name="value">Specifies the value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string section, string key, string value) {
|
||||
return (WritePrivateProfileString(section, key, value, Filename) != 0);
|
||||
}
|
||||
/// <summary>Writes a String to the specified key in the active section.</summary>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string key, string value) {
|
||||
return Write(Section, key, value);
|
||||
}
|
||||
/// <summary>Writes a Long to the specified key in the specified section.</summary>
|
||||
/// <param name="section">The section to write in.</param>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string section, string key, long value) {
|
||||
return Write(section, key, value.ToString());
|
||||
}
|
||||
/// <summary>Writes a Long to the specified key in the active section.</summary>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string key, long value) {
|
||||
return Write(Section, key, value);
|
||||
}
|
||||
/// <summary>Writes a Byte array to the specified key in the specified section.</summary>
|
||||
/// <param name="section">The section to write in.</param>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string section, string key, byte [] value) {
|
||||
if (value == null)
|
||||
return Write(section, key, (string)null);
|
||||
else
|
||||
return Write(section, key, value, 0, value.Length);
|
||||
}
|
||||
/// <summary>Writes a Byte array to the specified key in the active section.</summary>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string key, byte [] value) {
|
||||
return Write(Section, key, value);
|
||||
}
|
||||
/// <summary>Writes a Byte array to the specified key in the specified section.</summary>
|
||||
/// <param name="section">The section to write in.</param>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <param name="offset">An offset in <i>value</i>.</param>
|
||||
/// <param name="length">The number of elements of <i>value</i> to convert.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string section, string key, byte [] value, int offset, int length) {
|
||||
if (value == null)
|
||||
return Write(section, key, (string)null);
|
||||
else
|
||||
return Write(section, key, Convert.ToBase64String(value, offset, length));
|
||||
}
|
||||
/// <summary>Writes a Boolean to the specified key in the specified section.</summary>
|
||||
/// <param name="section">The section to write in.</param>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string section, string key, bool value) {
|
||||
return Write(section, key, value.ToString());
|
||||
}
|
||||
/// <summary>Writes a Boolean to the specified key in the active section.</summary>
|
||||
/// <param name="key">The key to write to.</param>
|
||||
/// <param name="value">The value to write.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool Write(string key, bool value) {
|
||||
return Write(Section, key, value);
|
||||
}
|
||||
/// <summary>Deletes a key from the specified section.</summary>
|
||||
/// <param name="section">The section to delete from.</param>
|
||||
/// <param name="key">The key to delete.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool DeleteKey(string section, string key) {
|
||||
return (WritePrivateProfileString(section, key, null, Filename) != 0);
|
||||
}
|
||||
/// <summary>Deletes a key from the active section.</summary>
|
||||
/// <param name="key">The key to delete.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool DeleteKey(string key) {
|
||||
return (WritePrivateProfileString(Section, key, null, Filename) != 0);
|
||||
}
|
||||
/// <summary>Deletes a section from an INI file.</summary>
|
||||
/// <param name="section">The section to delete.</param>
|
||||
/// <returns>Returns true if the function succeeds, false otherwise.</returns>
|
||||
public bool DeleteSection(string section) {
|
||||
return WritePrivateProfileSection(section, null, Filename) != 0;
|
||||
}
|
||||
/// <summary>Retrieves a list of all available sections in the INI file.</summary>
|
||||
/// <returns>Returns an ArrayList with all available sections.</returns>
|
||||
public ArrayList GetSectionNames() {
|
||||
try {
|
||||
byte[] buffer = new byte[MAX_ENTRY];
|
||||
GetPrivateProfileSectionNames(buffer, MAX_ENTRY, Filename);
|
||||
string [] parts = Encoding.ASCII.GetString(buffer).Trim('\0').Split('\0');
|
||||
return new ArrayList(parts);
|
||||
} catch {}
|
||||
return null;
|
||||
}
|
||||
//Private variables and constants
|
||||
/// <summary>
|
||||
/// Holds the full path to the INI file.
|
||||
/// </summary>
|
||||
private string m_Filename;
|
||||
/// <summary>
|
||||
/// Holds the active section name
|
||||
/// </summary>
|
||||
private string m_Section;
|
||||
/// <summary>
|
||||
/// The maximum number of bytes in a section buffer.
|
||||
/// </summary>
|
||||
private const int MAX_ENTRY = 32768;
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{889E30F7-CFBC-470D-9488-7009C354F9C9}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>IniReader</RootNamespace>
|
||||
<AssemblyName>IniReader</AssemblyName>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\veproms\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IniReader.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,81 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{2F79D7F9-885E-4441-99F3-045D7612B2E5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>MSWord</RootNamespace>
|
||||
<AssemblyName>MSWord</AssemblyName>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\veproms\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="WordDoc.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="Microsoft.Office.Core">
|
||||
<Guid>{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="VBIDE">
|
||||
<Guid>{0002E157-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>5</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="Word">
|
||||
<Guid>{00020905-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
<VersionMinor>3</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,138 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using LBWordLibrary;
|
||||
|
||||
namespace Volian.MSWord
|
||||
{
|
||||
public class WordDoc
|
||||
{
|
||||
private static LBApplicationClass _MyWordApp;
|
||||
public static LBApplicationClass MyWordApp
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_MyWordApp == null)
|
||||
_MyWordApp = new LBApplicationClass();
|
||||
return WordDoc._MyWordApp;
|
||||
}
|
||||
}
|
||||
private LBDocumentClass _MyWordDoc;
|
||||
public LBDocumentClass MyWordDoc
|
||||
{
|
||||
get
|
||||
{ return _MyWordDoc; }
|
||||
}
|
||||
private string _DocName;
|
||||
public string DocName
|
||||
{
|
||||
get { return _DocName; }
|
||||
set { _DocName = value; }
|
||||
}
|
||||
public WordDoc(string docName)
|
||||
{
|
||||
DocName = docName;
|
||||
_MyWordDoc = MyWordApp.Documents.Open(_DocName, false);
|
||||
}
|
||||
public string Save()
|
||||
{
|
||||
try
|
||||
{
|
||||
MyWordDoc.SaveAs(DocName, LBWdSaveFormat.wdFormatDocument);
|
||||
return "Successful Save";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return string.Format("Error during Doc save - {0}", ex.Message);
|
||||
}
|
||||
}
|
||||
public string Save(string docName)
|
||||
{
|
||||
DocName = docName;
|
||||
return Save();
|
||||
}
|
||||
public void Close()
|
||||
{
|
||||
MyWordDoc.Close(false);
|
||||
}
|
||||
public float SetLineSpacing(float linesPerInch) // if need landscape set too: , bool landscape)
|
||||
{
|
||||
float retval = 0;
|
||||
LBSelection selection = MyWordApp.Selection;
|
||||
selection.WholeStory();
|
||||
retval = selection.ParagraphFormat.LineSpacing;
|
||||
selection.ParagraphFormat.SpaceBefore = 0;
|
||||
selection.ParagraphFormat.SpaceAfter = 0;
|
||||
selection.ParagraphFormat.LineSpacingRule = LBWdLineSpacing.wdLineSpaceExactly;
|
||||
selection.ParagraphFormat.LineSpacing = 72 / linesPerInch;
|
||||
return retval;
|
||||
}
|
||||
public float Length
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
{
|
||||
return MyWordDoc.Length;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Error Getting Length, {0}", ex.Message);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
public static void CloseApp()
|
||||
{
|
||||
if(_MyWordApp != null)
|
||||
{
|
||||
TryToQuit();
|
||||
KillWordApps();
|
||||
}
|
||||
}
|
||||
|
||||
private static void TryToQuit()
|
||||
{
|
||||
try
|
||||
{
|
||||
_MyWordApp.Quit(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
_MyWordApp=null;
|
||||
}
|
||||
public static void KillWordApps()
|
||||
{
|
||||
try
|
||||
{
|
||||
TerminateProcesses(WordProcesses);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("{0} - {1}", ex.GetType().Name, ex.Message);
|
||||
}
|
||||
}
|
||||
public static void TerminateProcesses(System.Diagnostics.Process[] wordProcesses)
|
||||
{
|
||||
foreach (System.Diagnostics.Process proc in wordProcesses)
|
||||
{
|
||||
// Determine if Word is Visible
|
||||
// If it is let it run
|
||||
// otherwise Kill it.
|
||||
if(proc.MainWindowTitle=="")
|
||||
proc.Kill();
|
||||
}
|
||||
_MyWordApp = null;
|
||||
}
|
||||
public static System.Diagnostics.Process[] WordProcesses
|
||||
{
|
||||
get
|
||||
{
|
||||
return System.Diagnostics.Process.GetProcessesByName("WINWORD");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("IniReader")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Volian Enterprises, Inc.")]
|
||||
[assembly: AssemblyProduct("IniReader")]
|
||||
[assembly: AssemblyCopyright("Copyright © Volian Enterprises, Inc. 2006")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("0defcd71-3fa3-4b0c-8df0-64ca71984473")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -1,98 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{62314B9C-DA84-4037-8B68-AA18C1F641F5}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<NoStandardLibraries>false</NoStandardLibraries>
|
||||
<AssemblyName>Volian.Utils.Library</AssemblyName>
|
||||
<RootNamespace>Volian.Utils.Library</RootNamespace>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>.\bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>.\bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\Log4Net\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IniReader\IniReader.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="MSWord\WordDoc.cs" />
|
||||
<Compile Include="vlnObject\vlnObject.cs" />
|
||||
<Compile Include="vlnServerLibrary\vlnServer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="IniReader\IniReader.csproj" />
|
||||
<Content Include="MSWord\MSWord.csproj" />
|
||||
<Content Include="vlnObject\vlnObjectLibrary.csproj" />
|
||||
<Content Include="vlnServerLibrary\vlnServerLibrary.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LBWordLibrary\LBWordLibrary.csproj">
|
||||
<Project>{70F23722-19A3-4AC1-A900-55831C945786}</Project>
|
||||
<Name>LBWordLibrary</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="IniReader\Properties\" />
|
||||
<Folder Include="MSWord\Properties\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio AllowExistingFolder="true" />
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
@@ -1,282 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
using System.Xml;
|
||||
using System.Xml.Schema;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace vlnObjectLibrary
|
||||
{
|
||||
[Serializable()]
|
||||
public class vlnObject : IXmlSerializable , IDisposable
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
public void Dispose()
|
||||
{
|
||||
/* See if I need to do anything */
|
||||
}
|
||||
#region XML Serialization
|
||||
public void WriteXml(XmlWriter w)
|
||||
{
|
||||
WriteXml(w, true);
|
||||
}
|
||||
public void WriteXml(XmlWriter w,bool bSaveParent)
|
||||
{
|
||||
w.WriteAttributeString("title", Title);
|
||||
w.WriteAttributeString("path", Path);
|
||||
w.WriteAttributeString("type", Type);
|
||||
if (m_PropArray.Count > 0)
|
||||
{
|
||||
w.WriteStartElement("properties");
|
||||
foreach (string sKey in m_PropArray.Keys)
|
||||
{
|
||||
w.WriteStartElement("property");
|
||||
w.WriteAttributeString("name", sKey);
|
||||
w.WriteAttributeString("value", PropArray[sKey]);
|
||||
w.WriteEndElement();
|
||||
}
|
||||
w.WriteEndElement();
|
||||
}
|
||||
if (bSaveParent && Parent != null)
|
||||
{
|
||||
w.WriteStartElement("parent");
|
||||
Parent.WriteXml(w);
|
||||
w.WriteEndElement();
|
||||
}
|
||||
}
|
||||
private bool SkipToElement(XmlReader xr)
|
||||
{
|
||||
while (xr.Read())
|
||||
if (xr.NodeType == XmlNodeType.Element || xr.NodeType == XmlNodeType.EndElement)
|
||||
return xr.NodeType == XmlNodeType.Element;
|
||||
return false;
|
||||
}
|
||||
public void ReadXml(XmlReader xr)
|
||||
{
|
||||
SkipToElement(xr);
|
||||
if (xr.MoveToAttribute("title")) m_Title = xr.Value;
|
||||
if (xr.MoveToAttribute("type")) m_Type = xr.Value;
|
||||
if (xr.MoveToAttribute("path")) m_Path = xr.Value;
|
||||
while (SkipToElement(xr))
|
||||
{
|
||||
if (xr.NodeType == XmlNodeType.Element && xr.Name == "properties")
|
||||
while (SkipToElement(xr))
|
||||
if (xr.NodeType == XmlNodeType.Element && xr.Name == "property")
|
||||
AddProp(xr.ReadSubtree());
|
||||
if (xr.NodeType == XmlNodeType.Element && xr.Name == "parent")
|
||||
m_Parent = new vlnObject(xr.ReadSubtree());
|
||||
}
|
||||
xr.Close();
|
||||
}
|
||||
|
||||
public XmlSchema GetSchema()
|
||||
{
|
||||
return (null);
|
||||
}
|
||||
#endregion
|
||||
#region Constructors
|
||||
public vlnObject(vlnObject parent, string type, string title, string path)
|
||||
{
|
||||
m_Parent = parent;
|
||||
m_Type = type;
|
||||
m_Title = title;
|
||||
m_Path = path;
|
||||
m_PropArray = new Dictionary<string,string>();
|
||||
}
|
||||
public vlnObject()
|
||||
{
|
||||
m_Parent = null;
|
||||
m_Title = null;
|
||||
m_Path = null;
|
||||
m_Type = null;
|
||||
m_PropArray = new Dictionary<string, string>();
|
||||
}
|
||||
public vlnObject(XmlReader xr)
|
||||
{
|
||||
m_Parent = null;
|
||||
m_PropArray = new Dictionary<string, string>();
|
||||
this.ReadXml(xr);
|
||||
}
|
||||
public vlnObject(string sXML)
|
||||
{
|
||||
m_Parent = null;
|
||||
m_PropArray = new Dictionary<string, string>();
|
||||
this.ReadXml(new XmlTextReader(new StringReader(sXML)));
|
||||
}
|
||||
#endregion
|
||||
#region Public Properties
|
||||
private vlnObject m_Parent;
|
||||
public vlnObject Parent
|
||||
{
|
||||
get { return m_Parent; }
|
||||
set { m_Parent = value; }
|
||||
}
|
||||
private string m_Title;
|
||||
public string Title
|
||||
{
|
||||
get { return m_Title; }
|
||||
set { m_Title = value; }
|
||||
}
|
||||
private string m_Path;
|
||||
public string Path
|
||||
{
|
||||
get { return m_Path; }
|
||||
set { m_Path = value; }
|
||||
}
|
||||
private string m_Type;
|
||||
|
||||
public string Type
|
||||
{
|
||||
get { return m_Type; }
|
||||
set { m_Type = value; }
|
||||
}
|
||||
private Dictionary<string,string> m_PropArray;
|
||||
public Dictionary<string, string> PropArray
|
||||
{
|
||||
get { return m_PropArray; }
|
||||
set { m_PropArray = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Public Methods
|
||||
public vlnObject Add(string type, string title, string path)
|
||||
{
|
||||
vlnObject b = new vlnObject(this, type, title, path);
|
||||
return b;
|
||||
}
|
||||
public void AddProp(string name, string value)
|
||||
{
|
||||
PropArray[name.ToUpper()] = value;
|
||||
}
|
||||
public void AddProp(XmlReader xr)
|
||||
{
|
||||
SkipToElement(xr);
|
||||
string sName = null;
|
||||
string sValue = null;
|
||||
if (xr.MoveToAttribute("name")) sName = xr.Value;
|
||||
if (xr.MoveToAttribute("value")) sValue = xr.Value;
|
||||
if (sName != null && sValue != null) AddProp(sName, sValue);
|
||||
xr.Close();
|
||||
}
|
||||
public override string ToString()
|
||||
{
|
||||
StringWriter swxml = new StringWriter();
|
||||
XmlSerializer mySer = new XmlSerializer(this.GetType());
|
||||
mySer.Serialize(swxml, this);
|
||||
return swxml.ToString();
|
||||
}
|
||||
#endregion
|
||||
private List<vlnObject> m_Children;
|
||||
public List<vlnObject> Children
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_Children;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_Children = value;
|
||||
}
|
||||
}
|
||||
public void LoadChildren(string sXml)
|
||||
{
|
||||
LoadChildren(new XmlTextReader(new StringReader(sXml)));
|
||||
}
|
||||
public void LoadChildren(XmlReader xr)
|
||||
{
|
||||
m_Children = new List<vlnObject>();
|
||||
SkipToElement(xr);
|
||||
while(SkipToElement(xr)){
|
||||
vlnObject o = new vlnObject(xr.ReadSubtree());
|
||||
o.Parent = this;
|
||||
m_Children.Add(o);
|
||||
}
|
||||
}
|
||||
public string AllChildren()
|
||||
{
|
||||
StringWriter sw = new StringWriter();
|
||||
XmlTextWriter xw = new XmlTextWriter(sw);
|
||||
xw.WriteStartElement("children");
|
||||
foreach (vlnObject vb in Children)
|
||||
{
|
||||
xw.WriteStartElement("vlnObject");
|
||||
vb.WriteXml(xw,false);
|
||||
xw.WriteEndElement();
|
||||
}
|
||||
xw.WriteEndElement();
|
||||
return sw.ToString();
|
||||
}
|
||||
public string ProcessString(string s)
|
||||
{
|
||||
//string retval=s;
|
||||
//string retval = Regex.Replace(s, "{[.]*}", new MatchEvaluator(ReplaceKey));
|
||||
string retval = Regex.Replace(s, "{{.*?}}", new MatchEvaluator(ReplaceRow));
|
||||
retval = Regex.Replace(retval, "{.*?}", new MatchEvaluator(ReplaceDrv));
|
||||
return retval;
|
||||
}
|
||||
private string ReplaceRow(Match m)
|
||||
{
|
||||
string sResult = FindField(m.Value.Substring(2, m.Value.Length - 4));
|
||||
if (sResult == null && Parent != null)
|
||||
{
|
||||
sResult = Parent.ReplaceRow(m);
|
||||
}
|
||||
if (sResult == null)
|
||||
{
|
||||
log.ErrorFormat("vlnObject - Couldn't find {0}", m.Value);
|
||||
}
|
||||
return sResult;
|
||||
}
|
||||
private string ReplaceDrv(Match m)
|
||||
{
|
||||
string sRetVal = FindField(m.Value.Substring(1, m.Value.Length - 2));
|
||||
if (sRetVal == null) sRetVal = "";
|
||||
return sRetVal;
|
||||
}
|
||||
private string FindField(string s)
|
||||
{
|
||||
string retval = "";
|
||||
string[] parts = s.ToUpper().Split(":".ToCharArray());
|
||||
switch (s.ToUpper())
|
||||
{
|
||||
case "PATH":
|
||||
retval = m_Path;
|
||||
break;
|
||||
//case "TITLE":
|
||||
//retval = m_Title;
|
||||
//break;
|
||||
case "TYPE":
|
||||
retval = m_Type;
|
||||
break;
|
||||
default:
|
||||
if (PropArray.ContainsKey(parts[0]))
|
||||
{
|
||||
retval = PropArray[parts[0]].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (parts.Length > 1)
|
||||
{
|
||||
int width = Convert.ToInt32(parts[1]);
|
||||
if (parts[1][0] == ' ' || parts[1][0] == '0')
|
||||
{
|
||||
retval = retval.PadLeft(width, parts[1][0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
retval = retval.PadRight(width).Substring(0, width).Trim();
|
||||
}
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{933269F5-C3AD-423E-88EB-133A7333FD6B}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>vlnObject</RootNamespace>
|
||||
<AssemblyName>vlnObject</AssemblyName>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\veproms\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\veproms\bin\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="vlnObject.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="vlnControl.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,248 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using vlnObjectLibrary;
|
||||
using System.Xml;
|
||||
using System.IO;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.Reflection;
|
||||
|
||||
namespace vlnServerLibrary
|
||||
{
|
||||
public class vlnServer // This class loads children for a vlnObject
|
||||
{
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
#region Static Properties
|
||||
private static string m_XmlControlPath = "vlnControl.xml";
|
||||
private static XmlDocument m_XmlControl;
|
||||
public static string XMLControlPath
|
||||
{
|
||||
get { return m_XmlControlPath; }
|
||||
set
|
||||
{
|
||||
m_XmlControlPath = value;
|
||||
}
|
||||
}
|
||||
public static XmlDocument XMLControl
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_XmlControl == null)
|
||||
{
|
||||
m_XmlControl = new XmlDocument();
|
||||
lock (m_XmlControl)
|
||||
{
|
||||
m_XmlControl.Load(m_XmlControlPath);
|
||||
}
|
||||
}
|
||||
return m_XmlControl;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
private List<vlnObject> LoadChildren(vlnObject o)
|
||||
{
|
||||
o.Children = new List<vlnObject>();
|
||||
LoadChildrenFromFolders(o);
|
||||
LoadChildrenFromDB(o,LookUp(o,"select"));
|
||||
return o.Children;
|
||||
}
|
||||
public string GetChildren(string sVlnObject)
|
||||
{
|
||||
using (vlnObject o = new vlnObject(sVlnObject))
|
||||
{
|
||||
LoadChildren(o);
|
||||
return o.AllChildren();
|
||||
}
|
||||
}
|
||||
public string GetDataPath()
|
||||
{
|
||||
vlnObject o = new vlnObject();
|
||||
o.Type="datapath";
|
||||
o.Title="Data Path";
|
||||
o.Path=LookUpX(o,".//default/@datapath");
|
||||
return o.ToString();
|
||||
}
|
||||
protected string LookUp(vlnObject o,string s)
|
||||
{
|
||||
string xPath = string.Format(".//dbObject[@type='{0}']/@{1}", o.Type, s);
|
||||
return LookUpX(o,xPath);
|
||||
}
|
||||
protected string LookUpP(vlnObject o,string s)
|
||||
{
|
||||
string xPath = string.Format(".//dbObject[@type='{0}']/@{1}", o.Parent.Type, s);
|
||||
return LookUpX(o,xPath);
|
||||
}
|
||||
protected string LookUpX(vlnObject o,string xPath)
|
||||
{
|
||||
return LookUpX(o,xPath, XMLControl);
|
||||
}
|
||||
private void LoadChildrenFromDB(vlnObject o,string sSelect)
|
||||
{
|
||||
if (sSelect != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
string s = LookUpX(o,".//connection/@string");
|
||||
OleDbConnectionStringBuilder csb = new OleDbConnectionStringBuilder(s);
|
||||
OleDbConnection dbConn = new OleDbConnection(csb.ConnectionString);
|
||||
string sTable = LookUp(o,"table");
|
||||
//if (dbConn.State != ConnectionState.Open) dbConn.Open();
|
||||
OleDbDataAdapter da = new OleDbDataAdapter(sSelect, dbConn);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds, sTable);
|
||||
string srt = LookUp(o,"sort");
|
||||
DataView dv = new DataView(ds.Tables[sTable], LookUp(o,"criteria"), LookUp(o,"sort"), DataViewRowState.CurrentRows);
|
||||
foreach (DataRowView mydrv in dv)
|
||||
{
|
||||
vlnObject vb = o.Add(LookUp(o,"child"), "", o.Path);
|
||||
foreach (DataColumn dc in dv.Table.Columns)
|
||||
{
|
||||
vb.AddProp(dc.ColumnName, mydrv[dc.ColumnName].ToString());
|
||||
}
|
||||
vb.Title = LookUpP(vb,"title");
|
||||
o.Children.Add(vb);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("{0}\r\n{1}", ex.Message, ex.InnerException);
|
||||
}
|
||||
}
|
||||
}
|
||||
public DataSet GetDataSet(vlnObject o, string sSelect)
|
||||
{
|
||||
if (sSelect != "")
|
||||
{
|
||||
try
|
||||
{
|
||||
OleDbConnection dbConn = new OleDbConnection(LookUpX(o, ".//connection/@string"));
|
||||
OleDbDataAdapter da = new OleDbDataAdapter(sSelect, dbConn);
|
||||
DataSet ds = new DataSet();
|
||||
da.Fill(ds, LookUp(o, "table"));
|
||||
return ds;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("{0}\r\n{1}", ex.Message, ex.InnerException);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public OleDbDataReader GetDataReader(vlnObject o, string sSelect)
|
||||
{
|
||||
if (sSelect != "")
|
||||
{
|
||||
OleDbConnection dbConn = new OleDbConnection(LookUpX(o, ".//connection/@string"));
|
||||
OleDbCommand cmd = new OleDbCommand(sSelect, dbConn);
|
||||
cmd.CommandType = CommandType.Text;
|
||||
dbConn.Open();
|
||||
OleDbDataReader dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
|
||||
return dr;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
private void LoadChildrenFromFolders(vlnObject o)
|
||||
{
|
||||
// First look in the XML to see if there are any folders for the specified item
|
||||
XmlNodeList nl = XMLControl.SelectNodes(string.Format(".//dbObject[@type='{0}']/folders/folder", o.Type));
|
||||
if (nl.Count != 0)
|
||||
{
|
||||
foreach (XmlNode xn in nl)
|
||||
{
|
||||
LoadChildrenFromFolder(o,xn);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void LoadChildrenFromFolder(vlnObject o, XmlNode xn)
|
||||
{
|
||||
// First look in the XML to see if there are any folders for the specified item
|
||||
string sTmp = LookUpX(o,"@template", xn);
|
||||
if (sTmp != "")
|
||||
{
|
||||
string sException = LookUpX(o,"@exception", xn);
|
||||
string sRequired = LookUpX(o,"@requires", xn);
|
||||
DirectoryInfo di = new DirectoryInfo(o.Path);
|
||||
if (sRequired == "" || di.GetFileSystemInfos(sRequired).Length > 0)
|
||||
{
|
||||
if (sException == "" || di.GetFileSystemInfos(sException).Length == 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (sTmp == ".")
|
||||
{
|
||||
LoadChildrenFromFolder(o, xn, di);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(sTmp.Contains("\\")){
|
||||
string[] sTmps = sTmp.Split('\\');
|
||||
DirectoryInfo [] dis = di.GetDirectories(sTmps[0]);
|
||||
foreach (DirectoryInfo di2 in dis)
|
||||
{
|
||||
foreach (FileSystemInfo di3 in di2.GetFileSystemInfos(sTmps[1]))
|
||||
{
|
||||
LoadChildrenFromFolder(o, xn, di3);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (FileSystemInfo di1 in di.GetFileSystemInfos(sTmp))
|
||||
{
|
||||
LoadChildrenFromFolder(o, xn, di1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (DirectoryNotFoundException ex)
|
||||
{
|
||||
// Ignore this exception
|
||||
log.InfoFormat("Directory {0} Template {1} Error {2}",di, sTmp,ex.Message);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
log.ErrorFormat("Error: {0}\r\n{1}", ex.Message, ex.InnerException);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void LoadChildrenFromFolder(vlnObject o,XmlNode xn, FileSystemInfo fi)
|
||||
{
|
||||
vlnObject vb = o.Add(LookUpX(o,"@child", xn), "", fi.FullName);
|
||||
vb.AddProp("filename", fi.Name);
|
||||
vb.Title = GetTitle(fi.FullName, LookUpX(vb,"@title", xn));
|
||||
o.Children.Add(vb);
|
||||
}
|
||||
protected string GetTitle(string sPath, string sDefault)
|
||||
{
|
||||
string sRetval = sDefault;
|
||||
if (sRetval[0] == '~')
|
||||
{
|
||||
string sTitlePath = sPath + "\\title";
|
||||
if (File.Exists(sTitlePath))
|
||||
{
|
||||
StreamReader sr = File.OpenText(sTitlePath);
|
||||
return sr.ReadToEnd();
|
||||
}
|
||||
sRetval = sRetval.Substring(1);
|
||||
}
|
||||
return sRetval;
|
||||
}
|
||||
protected string LookUpX(vlnObject o, string xPath, XmlNode xn)
|
||||
{
|
||||
XmlNode nd = xn;
|
||||
XmlNode ndf = nd.SelectSingleNode(xPath);
|
||||
while (ndf == null && nd.ParentNode != null)
|
||||
{
|
||||
nd = nd.ParentNode;
|
||||
ndf = nd.SelectSingleNode(xPath);
|
||||
}
|
||||
if (ndf == null) return "";
|
||||
return o.ProcessString(ndf.InnerText);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F9B53DDC-2A2E-4A17-B777-4EC0EE585DE2}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>vlnServerLibrary</RootNamespace>
|
||||
<AssemblyName>vlnServerLibrary</AssemblyName>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\..\veproms\bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.9.0, Culture=neutral, PublicKeyToken=b32731d11ce58905">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\veproms\bin\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="vlnObject, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\veproms\bin\vlnObject.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="vlnServer.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -1,58 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
//
|
||||
// In order to sign your assembly you must specify a key to use. Refer to the
|
||||
// Microsoft .NET Framework documentation for more information on assembly signing.
|
||||
//
|
||||
// Use the attributes below to control which key is used for signing.
|
||||
//
|
||||
// Notes:
|
||||
// (*) If no key is specified, the assembly is not signed.
|
||||
// (*) KeyName refers to a key that has been installed in the Crypto Service
|
||||
// Provider (CSP) on your machine. KeyFile refers to a file which contains
|
||||
// a key.
|
||||
// (*) If the KeyFile and the KeyName values are both specified, the
|
||||
// following processing occurs:
|
||||
// (1) If the KeyName can be found in the CSP, that key is used.
|
||||
// (2) If the KeyName does not exist and the KeyFile does exist, the key
|
||||
// in the KeyFile is installed into the CSP and used.
|
||||
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
|
||||
// When specifying the KeyFile, the location of the KeyFile should be
|
||||
// relative to the project output directory which is
|
||||
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
|
||||
// located in the project directory, you would specify the AssemblyKeyFile
|
||||
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
|
||||
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
|
||||
// documentation for more information on this.
|
||||
//
|
||||
[assembly: AssemblyDelaySign(false)]
|
||||
[assembly: AssemblyKeyFile("")]
|
||||
[assembly: AssemblyKeyName("")]
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,194 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
|
||||
<PropertyGroup>
|
||||
<ProjectType>Local</ProjectType>
|
||||
<ProductVersion>8.0.50727</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{04E168D0-9CC7-43D9-A9F1-93E481EA86A3}</ProjectGuid>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ApplicationIcon>
|
||||
</ApplicationIcon>
|
||||
<AssemblyKeyContainerName>
|
||||
</AssemblyKeyContainerName>
|
||||
<AssemblyName>XYPlots</AssemblyName>
|
||||
<AssemblyOriginatorKeyFile>
|
||||
</AssemblyOriginatorKeyFile>
|
||||
<DefaultClientScript>JScript</DefaultClientScript>
|
||||
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
|
||||
<DefaultTargetSchema>IE50</DefaultTargetSchema>
|
||||
<DelaySign>false</DelaySign>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>XYPlots</RootNamespace>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<UpgradeBackupLocation>
|
||||
</UpgradeBackupLocation>
|
||||
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||
<OldToolsVersion>2.0</OldToolsVersion>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>false</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
|
||||
<ConfigurationOverrideFile>
|
||||
</ConfigurationOverrideFile>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<DocumentationFile>
|
||||
</DocumentationFile>
|
||||
<DebugSymbols>false</DebugSymbols>
|
||||
<FileAlignment>4096</FileAlignment>
|
||||
<NoStdLib>false</NoStdLib>
|
||||
<NoWarn>
|
||||
</NoWarn>
|
||||
<Optimize>true</Optimize>
|
||||
<RegisterForComInterop>false</RegisterForComInterop>
|
||||
<RemoveIntegerChecks>false</RemoveIntegerChecks>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DebugType>none</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Demo|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Demo\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>
|
||||
</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Demo|x86' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\Demo\</OutputPath>
|
||||
<DefineConstants>TRACE;DEMO</DefineConstants>
|
||||
<BaseAddress>285212672</BaseAddress>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\3rdPartyLibraries\Log4Net\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System">
|
||||
<Name>System</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Data">
|
||||
<Name>System.Data</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing">
|
||||
<Name>System.Drawing</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Windows.Forms">
|
||||
<Name>System.Windows.Forms</Name>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml">
|
||||
<Name>System.XML</Name>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmXYPlot.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="frmXYPlot.designer.cs">
|
||||
<DependentUpon>frmXYPlot.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="XYPlots.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="frmXYPlot.resx">
|
||||
<DependentUpon>frmXYPlot.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\VG\VG.csproj">
|
||||
<Project>{52D74078-3822-410E-889B-464BD21AAB9E}</Project>
|
||||
<Name>VG</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Volian.Base.Library\Volian.Base.Library.csproj">
|
||||
<Project>{aeee9fd1-6892-45e2-a67e-418c06d46ff9}</Project>
|
||||
<Name>Volian.Base.Library</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
</PreBuildEvent>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,63 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Printing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using VG;
|
||||
//using XYPlots;
|
||||
|
||||
namespace XYPlots
|
||||
{
|
||||
public partial class frmXYPlot : Form
|
||||
{
|
||||
private string _XYPlot;
|
||||
private string _Title;
|
||||
public frmXYPlot(string title,string xyPlot)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
title = Regex.Replace(title, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
|
||||
xyPlot = Regex.Replace(xyPlot, @"\\u([0-9]{1,4})\?", m => int.TryParse(m?.Groups[1]?.Value, out int result) ? Convert.ToChar(result).ToString() : ""); // C2022-003 RO Symbols. Convert unicode to character.
|
||||
|
||||
int pstart = xyPlot.IndexOf("<<G"); // find the starting Plot Command
|
||||
xyPlot = xyPlot.Substring(pstart); // set val to the start of the plot commands
|
||||
_XYPlot =xyPlot;
|
||||
_Title = title;
|
||||
}
|
||||
private void pnl_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
||||
e.Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
|
||||
XYPlots.XYPlot myPlot = new XYPlots.XYPlot(_XYPlot);
|
||||
myPlot.SetMargins(.75F, .5F, .25F, .75F);
|
||||
float scaleX = pnl.Width / myPlot.Width;
|
||||
float scaleY = pnl.Height / myPlot.Height;
|
||||
float scale = scaleX > scaleY ? scaleY : scaleX;
|
||||
e.Graphics.ScaleTransform(scale, scale);
|
||||
myPlot.Process(new VGOut_Graphics(e.Graphics));
|
||||
}
|
||||
private void pnl_Resize(object sender, EventArgs e)
|
||||
{
|
||||
pnl.Invalidate();
|
||||
}
|
||||
private void frmXYPlot_Load(object sender, EventArgs e)
|
||||
{
|
||||
Text = _Title;
|
||||
XYPlots.XYPlot myPlot = new XYPlots.XYPlot(_XYPlot);
|
||||
myPlot.SetMargins(.75F, .5F, .25F, .75F);
|
||||
float scaleX = pnl.Width / myPlot.Width;
|
||||
float scaleY = pnl.Height / myPlot.Height;
|
||||
float scale = scaleX > scaleY ? scaleY : scaleX;
|
||||
int height = (int)(Height - pnl.Height + pnl.Height * scale / scaleY);
|
||||
int width = (int)(Width - pnl.Width + pnl.Width * scale / scaleX);
|
||||
Size = new Size(width, height);
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-61
@@ -1,61 +0,0 @@
|
||||
namespace XYPlots
|
||||
{
|
||||
partial class frmXYPlot
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.pnl = new System.Windows.Forms.Panel();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// pnl
|
||||
//
|
||||
this.pnl.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.pnl.Location = new System.Drawing.Point(0, 0);
|
||||
this.pnl.Name = "pnl";
|
||||
this.pnl.Size = new System.Drawing.Size(818, 702);
|
||||
this.pnl.TabIndex = 1;
|
||||
this.pnl.Paint += new System.Windows.Forms.PaintEventHandler(this.pnl_Paint);
|
||||
this.pnl.Resize += new System.EventHandler(this.pnl_Resize);
|
||||
//
|
||||
// frmXYPlot
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(818, 702);
|
||||
this.Controls.Add(this.pnl);
|
||||
this.Name = "frmXYPlot";
|
||||
this.Text = "frmXYPlot";
|
||||
this.Load += new System.EventHandler(this.frmXYPlot_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel pnl;
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in new issue
Block a user