Properties Panel & Load Testing

Properties panel elements now have dynamic layout
Added console command to spawn lots of entities for load testing
This commit is contained in:
hyperion51 2020-06-04 01:36:55 +01:00
commit b0d7fa4904
69 changed files with 5299 additions and 3229 deletions

View file

@ -1,188 +1,188 @@
#if TEST_MSAGL
using System;
using Microsoft.Msagl.Core.Geometry.Curves;
using System.Diagnostics.CodeAnalysis;
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
///</summary>
[Serializable]
public class DebugCurve : DebugShape {
/// <summary>
/// color transparency
/// </summary>
public byte Transparency { get; set; }
double width = 1;
///<summary>
///</summary>
public ICurve Curve { get; set; }
///<summary>
///</summary>
public double Width {
get { return width; }
set { width = value; }
}
///<summary>
///</summary>
///<param name="transparency"></param>
///<param name="width"></param>
///<param name="curve"></param>
///<param name="color"></param>
///<param name="id"></param>
public DebugCurve(byte transparency, double width, string color, ICurve curve, object id)
: this(width, color, curve, id) {
Transparency = transparency;
}
///<summary>
///</summary>
///<param name="transparency"></param>
///<param name="width"></param>
///<param name="curve"></param>
///<param name="color"></param>
///<param name="dashArray"></param>
public DebugCurve(byte transparency, double width, string color, ICurve curve, double [] dashArray)
: this(width, color, curve, null) {
Transparency = transparency;
DashArray = dashArray;
}
///<summary>
///</summary>
///<param name="transparency"></param>
///<param name="width"></param>
///<param name="curve"></param>
///<param name="color"></param>
public DebugCurve(byte transparency, double width, string color, ICurve curve)
: this(width, color, curve, null)
{
Transparency = transparency;
}
/// <summary>
/// </summary>
/// <param name="transparency"></param>
/// <param name="width"></param>
/// <param name="color"></param>
/// <param name="fillColor"></param>
/// <param name="curve"></param>
public DebugCurve(byte transparency, double width, string color, string fillColor, ICurve curve)
: this(width, color, fillColor, curve, null) {
Transparency = transparency;
}
///<summary>
///</summary>
///<param name="width"></param>
///<param name="color"></param>
///<param name="curve"></param>
public DebugCurve(double width, string color, ICurve curve):this(width,color,curve,null)
{
}
///<summary>
///</summary>
///<param name="width"></param>
///<param name="color"></param>
///<param name="curve"></param>
///<param name="id"></param>
public DebugCurve(double width, string color, ICurve curve, object id) {
Transparency = 255;
Width = width;
Color = color;
Curve = curve;
Label = id;
}
/// <summary>
/// </summary>
/// <param name="width"></param>
/// <param name="color"></param>
/// <param name="fillColor"></param>
/// <param name="curve"></param>
/// <param name="id"></param>
public DebugCurve(double width, string color,string fillColor, ICurve curve, object id): this(width, color, curve, null) {
FillColor = fillColor;
}
///<summary>
///</summary>
public object Label { get; set; }
///<summary>
///</summary>
///<param name="curve"></param>
///<param name="color"></param>
public DebugCurve(string color, ICurve curve):this(1, color, curve, null){}
///<summary>
///</summary>
///<param name="curve"></param>
///<param name="pen"></param>
public DebugCurve(double pen, ICurve curve) : this(pen, "black", curve, null){}
///<summary>
///</summary>
///<param name="curve"></param>
///<param name="id"></param>
public DebugCurve(ICurve curve, object id) : this(1, "black", curve, id) { }
///<summary>
///</summary>
///<param name="color"></param>
///<param name="curve"></param>
///<param name="id"></param>
public DebugCurve(string color, ICurve curve, object id) : this(1, color, curve, id) { }
///<summary>
///</summary>
///<param name="curve"></param>
public DebugCurve(ICurve curve) : this(1, "black", curve, null) { }
/// <summary>
/// color strings for debugging
/// </summary>
[SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
public static readonly string[] Colors = {
"DeepSkyBlue", "IndianRed", "Orange", "Gold", "DarkRed", "Plum",
"Red", "Violet", "Indigo", "Yellow", "OrangeRed", "Tomato", "Purple"
, "SaddleBrown", "Green", "Navy", "Aqua", "Pink", "Bisque", "Black",
"BlanchedAlmond", "Blue", "BlueViolet", "Brown", "Lime", "BurlyWood"
, "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson",
"Cyan", "CadetBlue", "Chartreuse", "DarkBlue", "DarkCyan",
"DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta"
, "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkSalmon",
"DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise",
"DarkViolet", "DeepPink", "DimGray", "DodgerBlue", "Firebrick",
"FloralWhite", "ForestGreen", "Fuchsia", "CodeAnalysis", "Gainsboro"
, "GhostWhite", "Goldenrod", "Gray", "GreenYellow", "Honeydew",
"HotPink", "Ivory", "Lavender", "LavenderBlush", "LawnGreen",
"LemonChiffon", "LightBlue", "LightCoral", "LightCyan",
"LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink",
"LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray",
"LightSteelBlue", "LightYellow", "LimeGreen", "Linen", "Magenta",
"Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid",
"MediumPurple", "MediumSeaGreen", "MediumSlateBlue",
"MediumSpringGreen", "MediumTurquoise", "MediumVioletRed",
"MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite",
"OldLace", "Olive", "OliveDrab", "Orchid", "PaleGoldenrod",
"PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip",
"PeachPuff", "Peru", "PowderBlue", "RosyBrown", "RoyalBlue",
"Salmon", "SandyBrown", "SeaGreen", "CodeAnalysis", "SeaShell",
"Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow",
"SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Transparent",
"Turquoise", "Aquamarine", "Azure", "Beige", "Wheat", "White",
"WhiteSmoke", "YellowGreen", "Khaki", "AntiqueWhite"
};
///<summary>
/// the pattern of dashes
///</summary>
public double [] DashArray;
}
}
#endif
// #if TEST_MSAGL
// using System;
// using Microsoft.Msagl.Core.Geometry.Curves;
// using System.Diagnostics.CodeAnalysis;
//
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// ///</summary>
// [Serializable]
// public class DebugCurve : DebugShape {
// /// <summary>
// /// color transparency
// /// </summary>
// public byte Transparency { get; set; }
//
// double width = 1;
//
// ///<summary>
// ///</summary>
// public ICurve Curve { get; set; }
//
// ///<summary>
// ///</summary>
// public double Width {
// get { return width; }
// set { width = value; }
// }
//
// ///<summary>
// ///</summary>
// ///<param name="transparency"></param>
// ///<param name="width"></param>
// ///<param name="curve"></param>
// ///<param name="color"></param>
// ///<param name="id"></param>
// public DebugCurve(byte transparency, double width, string color, ICurve curve, object id)
// : this(width, color, curve, id) {
// Transparency = transparency;
// }
//
// ///<summary>
// ///</summary>
// ///<param name="transparency"></param>
// ///<param name="width"></param>
// ///<param name="curve"></param>
// ///<param name="color"></param>
// ///<param name="dashArray"></param>
// public DebugCurve(byte transparency, double width, string color, ICurve curve, double [] dashArray)
// : this(width, color, curve, null) {
// Transparency = transparency;
// DashArray = dashArray;
// }
//
// ///<summary>
// ///</summary>
// ///<param name="transparency"></param>
// ///<param name="width"></param>
// ///<param name="curve"></param>
// ///<param name="color"></param>
// public DebugCurve(byte transparency, double width, string color, ICurve curve)
// : this(width, color, curve, null)
// {
// Transparency = transparency;
// }
// /// <summary>
// /// </summary>
// /// <param name="transparency"></param>
// /// <param name="width"></param>
// /// <param name="color"></param>
// /// <param name="fillColor"></param>
// /// <param name="curve"></param>
// public DebugCurve(byte transparency, double width, string color, string fillColor, ICurve curve)
// : this(width, color, fillColor, curve, null) {
// Transparency = transparency;
// }
//
// ///<summary>
// ///</summary>
// ///<param name="width"></param>
// ///<param name="color"></param>
// ///<param name="curve"></param>
// public DebugCurve(double width, string color, ICurve curve):this(width,color,curve,null)
// {
//
// }
// ///<summary>
// ///</summary>
// ///<param name="width"></param>
// ///<param name="color"></param>
// ///<param name="curve"></param>
// ///<param name="id"></param>
// public DebugCurve(double width, string color, ICurve curve, object id) {
// Transparency = 255;
// Width = width;
// Color = color;
// Curve = curve;
// Label = id;
// }
// /// <summary>
// /// </summary>
// /// <param name="width"></param>
// /// <param name="color"></param>
// /// <param name="fillColor"></param>
// /// <param name="curve"></param>
// /// <param name="id"></param>
// public DebugCurve(double width, string color,string fillColor, ICurve curve, object id): this(width, color, curve, null) {
// FillColor = fillColor;
// }
//
// ///<summary>
// ///</summary>
// public object Label { get; set; }
//
// ///<summary>
// ///</summary>
// ///<param name="curve"></param>
// ///<param name="color"></param>
// public DebugCurve(string color, ICurve curve):this(1, color, curve, null){}
//
// ///<summary>
// ///</summary>
// ///<param name="curve"></param>
// ///<param name="pen"></param>
// public DebugCurve(double pen, ICurve curve) : this(pen, "black", curve, null){}
//
// ///<summary>
// ///</summary>
// ///<param name="curve"></param>
// ///<param name="id"></param>
// public DebugCurve(ICurve curve, object id) : this(1, "black", curve, id) { }
//
// ///<summary>
// ///</summary>
// ///<param name="color"></param>
// ///<param name="curve"></param>
// ///<param name="id"></param>
// public DebugCurve(string color, ICurve curve, object id) : this(1, color, curve, id) { }
//
//
// ///<summary>
// ///</summary>
// ///<param name="curve"></param>
// public DebugCurve(ICurve curve) : this(1, "black", curve, null) { }
//
// /// <summary>
// /// color strings for debugging
// /// </summary>
// [SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
// public static readonly string[] Colors = {
// "DeepSkyBlue", "IndianRed", "Orange", "Gold", "DarkRed", "Plum",
// "Red", "Violet", "Indigo", "Yellow", "OrangeRed", "Tomato", "Purple"
// , "SaddleBrown", "Green", "Navy", "Aqua", "Pink", "Bisque", "Black",
// "BlanchedAlmond", "Blue", "BlueViolet", "Brown", "Lime", "BurlyWood"
// , "Chocolate", "Coral", "CornflowerBlue", "Cornsilk", "Crimson",
// "Cyan", "CadetBlue", "Chartreuse", "DarkBlue", "DarkCyan",
// "DarkGoldenrod", "DarkGray", "DarkGreen", "DarkKhaki", "DarkMagenta"
// , "DarkOliveGreen", "DarkOrange", "DarkOrchid", "DarkSalmon",
// "DarkSeaGreen", "DarkSlateBlue", "DarkSlateGray", "DarkTurquoise",
// "DarkViolet", "DeepPink", "DimGray", "DodgerBlue", "Firebrick",
// "FloralWhite", "ForestGreen", "Fuchsia", "CodeAnalysis", "Gainsboro"
// , "GhostWhite", "Goldenrod", "Gray", "GreenYellow", "Honeydew",
// "HotPink", "Ivory", "Lavender", "LavenderBlush", "LawnGreen",
// "LemonChiffon", "LightBlue", "LightCoral", "LightCyan",
// "LightGoldenrodYellow", "LightGray", "LightGreen", "LightPink",
// "LightSalmon", "LightSeaGreen", "LightSkyBlue", "LightSlateGray",
// "LightSteelBlue", "LightYellow", "LimeGreen", "Linen", "Magenta",
// "Maroon", "MediumAquamarine", "MediumBlue", "MediumOrchid",
// "MediumPurple", "MediumSeaGreen", "MediumSlateBlue",
// "MediumSpringGreen", "MediumTurquoise", "MediumVioletRed",
// "MidnightBlue", "MintCream", "MistyRose", "Moccasin", "NavajoWhite",
// "OldLace", "Olive", "OliveDrab", "Orchid", "PaleGoldenrod",
// "PaleGreen", "PaleTurquoise", "PaleVioletRed", "PapayaWhip",
// "PeachPuff", "Peru", "PowderBlue", "RosyBrown", "RoyalBlue",
// "Salmon", "SandyBrown", "SeaGreen", "CodeAnalysis", "SeaShell",
// "Sienna", "Silver", "SkyBlue", "SlateBlue", "SlateGray", "Snow",
// "SpringGreen", "SteelBlue", "Tan", "Teal", "Thistle", "Transparent",
// "Turquoise", "Aquamarine", "Azure", "Beige", "Wheat", "White",
// "WhiteSmoke", "YellowGreen", "Khaki", "AntiqueWhite"
// };
//
// ///<summary>
// /// the pattern of dashes
// ///</summary>
// public double [] DashArray;
// }
//
// }
// #endif

View file

@ -1,64 +1,64 @@
#if TEST_MSAGL
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
namespace Microsoft.Msagl.DebugHelpers{
/// <summary>
///
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix"), Serializable]
public class DebugCurveCollection{
/// <summary>
///
/// </summary>
/// <param name="debugCurves"></param>
DebugCurveCollection(IEnumerable<DebugCurve> debugCurves){
DebugCurvesArray = debugCurves.ToArray();
}
/// <summary>
///
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
public DebugCurve[] DebugCurvesArray;
///<summary>
///</summary>
///<param name="debugCurves"></param>
///<param name="fileName"></param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
public static void WriteToFile(IEnumerable<DebugCurve> debugCurves, string fileName) {
Stream stream = File.Open(fileName, FileMode.Create);
var bformatter = new BinaryFormatter();
try {
bformatter.Serialize(stream, new DebugCurveCollection(debugCurves));
}
catch (SerializationException e) {
Console.WriteLine(e.ToString());
}
stream.Close();
}
///<summary>
///</summary>
///<param name="fileName"></param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
public static IEnumerable<DebugCurve> ReadFromFile(string fileName) {
Stream stream = File.Open(fileName, FileMode.Open);
var bformatter = new BinaryFormatter();
DebugCurveCollection dc = null;
try {
dc = bformatter.Deserialize(stream) as DebugCurveCollection;
}
catch (SerializationException e) {
Console.WriteLine(e.ToString());
}
stream.Close();
return new List<DebugCurve>(dc.DebugCurvesArray);
}
}
}
#endif
// #if TEST_MSAGL
// using System;
// using System.Collections.Generic;
// using System.IO;
// using System.Linq;
// using System.Runtime.Serialization;
// using System.Runtime.Serialization.Formatters.Binary;
//
// namespace Microsoft.Msagl.DebugHelpers{
// /// <summary>
// ///
// /// </summary>
// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1711:IdentifiersShouldNotHaveIncorrectSuffix"), Serializable]
// public class DebugCurveCollection{
// /// <summary>
// ///
// /// </summary>
// /// <param name="debugCurves"></param>
// DebugCurveCollection(IEnumerable<DebugCurve> debugCurves){
// DebugCurvesArray = debugCurves.ToArray();
// }
// /// <summary>
// ///
// /// </summary>
// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1051:DoNotDeclareVisibleInstanceFields")]
// public DebugCurve[] DebugCurvesArray;
//
// ///<summary>
// ///</summary>
// ///<param name="debugCurves"></param>
// ///<param name="fileName"></param>
// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
// public static void WriteToFile(IEnumerable<DebugCurve> debugCurves, string fileName) {
// Stream stream = File.Open(fileName, FileMode.Create);
// var bformatter = new BinaryFormatter();
// try {
// bformatter.Serialize(stream, new DebugCurveCollection(debugCurves));
// }
// catch (SerializationException e) {
// Console.WriteLine(e.ToString());
// }
// stream.Close();
// }
//
// ///<summary>
// ///</summary>
// ///<param name="fileName"></param>
// [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
// public static IEnumerable<DebugCurve> ReadFromFile(string fileName) {
// Stream stream = File.Open(fileName, FileMode.Open);
// var bformatter = new BinaryFormatter();
// DebugCurveCollection dc = null;
// try {
// dc = bformatter.Deserialize(stream) as DebugCurveCollection;
// }
// catch (SerializationException e) {
// Console.WriteLine(e.ToString());
// }
// stream.Close();
// return new List<DebugCurve>(dc.DebugCurvesArray);
// }
// }
// }
// #endif

View file

@ -1,14 +1,14 @@
using Microsoft.Msagl.Core.Geometry.Curves;
#if DEBUG
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
///</summary>
public class DebugEllipse : DebugShape {
/// <summary>
///
/// </summary>
public Ellipse Ellipse { get; set; }
}
}
#endif
// #if DEBUG
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// ///</summary>
// public class DebugEllipse : DebugShape {
// /// <summary>
// ///
// /// </summary>
// public Ellipse Ellipse { get; set; }
// }
// }
// #endif

View file

@ -1,16 +1,16 @@
#if DEBUG && !SHARPKIT
using System.Collections.Generic;
namespace Microsoft.Msagl.DebugHelpers {
class DebugGraphics : IDebugGraphics {
List<DebugShape> shapes = new List<DebugShape>();
public IList<DebugShape> Shapes {
get { return shapes; }
}
public void Clear() {
shapes.Clear();
}
}
}
#endif
// #if DEBUG && !SHARPKIT
// using System.Collections.Generic;
//
// namespace Microsoft.Msagl.DebugHelpers {
// class DebugGraphics : IDebugGraphics {
// List<DebugShape> shapes = new List<DebugShape>();
// public IList<DebugShape> Shapes {
// get { return shapes; }
// }
//
// public void Clear() {
// shapes.Clear();
// }
// }
// }
// #endif

View file

@ -1,14 +1,14 @@
using Microsoft.Msagl.Core.Geometry;
#if DEBUG && !SHARPKIT
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
///</summary>
public class DebugRectangle : DebugShape {
/// <summary>
///
/// </summary>
public Rectangle Rectangle { get; set; }
}
}
#endif
// using Microsoft.Msagl.Core.Geometry;
//
// #if DEBUG && !SHARPKIT
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// ///</summary>
// public class DebugRectangle : DebugShape {
// /// <summary>
// ///
// /// </summary>
// public Rectangle Rectangle { get; set; }
// }
// }
// #endif

View file

@ -1,23 +1,23 @@
#if DEBUG
using System;
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
///</summary>
[Serializable]
public class DebugShape {
///<summary>
///</summary>
public int Pen { get; set; }
///<summary>
///</summary>
public string Color { get; set; }
/// <summary>
/// Filling Color of the Shape.
/// </summary>
public string FillColor { get; set;}
}
}
#endif
// #if DEBUG
// using System;
//
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// ///</summary>
// [Serializable]
//
// public class DebugShape {
// ///<summary>
// ///</summary>
// public int Pen { get; set; }
// ///<summary>
// ///</summary>
// public string Color { get; set; }
// /// <summary>
// /// Filling Color of the Shape.
// /// </summary>
// public string FillColor { get; set;}
//
// }
// }
// #endif

View file

@ -1,18 +1,18 @@
#if DEBUG && !SHARPKIT
using System.Collections.Generic;
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
///</summary>
public interface IDebugGraphics {
/// <summary>
///
/// </summary>
IList<DebugShape> Shapes { get; }
/// <summary>
///
/// </summary>
void Clear();
}
}
#endif
// #if DEBUG && !SHARPKIT
// using System.Collections.Generic;
//
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// ///</summary>
// public interface IDebugGraphics {
// /// <summary>
// ///
// /// </summary>
// IList<DebugShape> Shapes { get; }
// /// <summary>
// ///
// /// </summary>
// void Clear();
// }
// }
// #endif

View file

@ -1,9 +1,9 @@
#if TEST_MSAGL
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
/// shows shapes
///</summary>
///<param name="shapes"></param>
public delegate void ShowDebugCurves(params DebugCurve[] shapes);
}
#endif
// #if TEST_MSAGL
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// /// shows shapes
// ///</summary>
// ///<param name="shapes"></param>
// public delegate void ShowDebugCurves(params DebugCurve[] shapes);
// }
// #endif

View file

@ -1,11 +1,11 @@
#if TEST_MSAGL
using System.Collections.Generic;
namespace Microsoft.Msagl.DebugHelpers {
///<summary>
/// shows shapes
///</summary>
///<param name="shapes"></param>
public delegate void ShowDebugCurvesEnumeration(IEnumerable<DebugCurve> shapes);
}
#endif
// #if TEST_MSAGL
// using System.Collections.Generic;
//
// namespace Microsoft.Msagl.DebugHelpers {
// ///<summary>
// /// shows shapes
// ///</summary>
// ///<param name="shapes"></param>
// public delegate void ShowDebugCurvesEnumeration(IEnumerable<DebugCurve> shapes);
// }
// #endif