CSLA - Extension

This commit is contained in:
2026-09-01 08:21:41 -04:00
parent dcd2fbc294
commit dab65dbfb6
30 changed files with 2703 additions and 5680 deletions
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace VEPROMS.CSLA.Library
{
@@ -21,26 +19,28 @@ namespace VEPROMS.CSLA.Library
// if the dictionary hasn't been set yet,
if (ColorIndx==null)
{
ColorIndx = new Dictionary<string, int>();
ColorIndx["black"] = 1;
ColorIndx["blue"] = 2;
ColorIndx["green"] = 3;
ColorIndx["cyan"] = 4;
ColorIndx["red"] = 5;
ColorIndx["magenta"] = 6;
ColorIndx["brown"] = 7;
ColorIndx["lightgray"] = 8;
ColorIndx["darkgray"] = 9;
ColorIndx["lightblue"] = 10;
ColorIndx["lightgreen"] = 11;
ColorIndx["lightcyan"] = 12;
ColorIndx["lightred"] = 13;
ColorIndx["lightmagenta"] = 14;
ColorIndx["yellow"] = 15;
ColorIndx["white"] = 16;
ColorIndx["ro"] = 17;
ColorIndx["trans"] = 18;
ColorIndx["editbackground"] = 19;
ColorIndx = new Dictionary<string, int>
{
["black"] = 1,
["blue"] = 2,
["green"] = 3,
["cyan"] = 4,
["red"] = 5,
["magenta"] = 6,
["brown"] = 7,
["lightgray"] = 8,
["darkgray"] = 9,
["lightblue"] = 10,
["lightgreen"] = 11,
["lightcyan"] = 12,
["lightred"] = 13,
["lightmagenta"] = 14,
["yellow"] = 15,
["white"] = 16,
["ro"] = 17,
["trans"] = 18,
["editbackground"] = 19
};
}
return ColorIndx[color];
}
@@ -49,49 +49,49 @@ namespace VEPROMS.CSLA.Library
// This gets the rtf color table string for the input color.
public static string GetTableString(string color)
{
Dictionary<string, int> ColorIndx = new Dictionary<string, int>();
if (ColorRtf == null)
{
ColorRtf = new Dictionary<string, string>();
// color table, from 16-bit code, is defined as (in order):
// black=0,0,0
// blue=0,0,255
// green=0,155,12
// cyan=0,136,159
// red=255,0,0
// magenta=202,28,175
// brown=128,64,0
// lightgray=0,0,0
// darkgray=0,0,0
// lightblue=0,0,255
// lightgreen=0,255,0
// lightcyan=0,0,255
// lightred=209,29,183
// lightmagenta=255,0,255
// yellow=255,0,0
// white=128,128,128
// ro=255,128,0
// editbackground=192,192,192
ColorRtf["black"] = "\\red0\\green0\\blue0;";
ColorRtf["blue"] = "\\red0\\green0\\blue255;";
ColorRtf["green"] = "\\red0\\green155\\blue12;";
ColorRtf["cyan"] = "\\red0\\green136\\blue159;";
ColorRtf["red"] = "\\red255\\green0\\blue0;";
ColorRtf["magenta"] = "\\red202\\green28\\blue175;";
ColorRtf["brown"] = "\\red128\\green64\\blue0;";
ColorRtf["lightgray"] = "\\red100\\green100\\blue100;";
ColorRtf["darkgray"] = "\\red10\\green10\\blue10;";
ColorRtf["lightblue"] = "\\red0\\green0\\blue255;";
ColorRtf["lightgreen"] = "\\red0\\green255\\blue0;";
ColorRtf["lightcyan"] = "\\red0\\green0\\blue255;";
ColorRtf["lightred"] = "\\red209\\green29\\blue183;";
ColorRtf["lightmagenta"] = "\\red255\\green0\\blue255;";
ColorRtf["yellow"] = "\\red255\\green0\\blue0;";
ColorRtf["white"] = "\\red128\\green128\\blue128;";
ColorRtf["ro"] = "\\red255\\green128\\blue0;";
ColorRtf["trans"] = "\\red255\\green128\\blue0;";
ColorRtf["editbackground"] = "\\red192\\green192\\blue192;";
ColorRtf = new Dictionary<string, string>
{
// color table, from 16-bit code, is defined as (in order):
// black=0,0,0
// blue=0,0,255
// green=0,155,12
// cyan=0,136,159
// red=255,0,0
// magenta=202,28,175
// brown=128,64,0
// lightgray=0,0,0
// darkgray=0,0,0
// lightblue=0,0,255
// lightgreen=0,255,0
// lightcyan=0,0,255
// lightred=209,29,183
// lightmagenta=255,0,255
// yellow=255,0,0
// white=128,128,128
// ro=255,128,0
// editbackground=192,192,192
["black"] = "\\red0\\green0\\blue0;",
["blue"] = "\\red0\\green0\\blue255;",
["green"] = "\\red0\\green155\\blue12;",
["cyan"] = "\\red0\\green136\\blue159;",
["red"] = "\\red255\\green0\\blue0;",
["magenta"] = "\\red202\\green28\\blue175;",
["brown"] = "\\red128\\green64\\blue0;",
["lightgray"] = "\\red100\\green100\\blue100;",
["darkgray"] = "\\red10\\green10\\blue10;",
["lightblue"] = "\\red0\\green0\\blue255;",
["lightgreen"] = "\\red0\\green255\\blue0;",
["lightcyan"] = "\\red0\\green0\\blue255;",
["lightred"] = "\\red209\\green29\\blue183;",
["lightmagenta"] = "\\red255\\green0\\blue255;",
["yellow"] = "\\red255\\green0\\blue0;",
["white"] = "\\red128\\green128\\blue128;",
["ro"] = "\\red255\\green128\\blue0;",
["trans"] = "\\red255\\green128\\blue0;",
["editbackground"] = "\\red192\\green192\\blue192;"
};
}
return ColorRtf[color];
}