issue #1 add save of own mappings into the SC ..\Controls\Mappings folder (for now)

Loading from own or SC provided mappings
pull/20/head
bm98 10 years ago
parent 0158172b99
commit ed3672f2c3

@ -43,6 +43,14 @@ namespace SCJMapper_V2
set { this["DefMappingName"] = value; }
}
[UserScopedSettingAttribute( )]
[DefaultSettingValueAttribute( "layout_my_joystick" )] // just a default
public String MyMappingName
{
get { return ( String )this["MyMappingName"]; }
set { this["MyMappingName"] = value; }
}
}

141
Form1.Designer.cs generated

@ -77,6 +77,8 @@
this.tlpanel = new System.Windows.Forms.TableLayoutPanel();
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.txFilter = new System.Windows.Forms.TextBox();
this.btClearFilter = new System.Windows.Forms.Button();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
@ -92,8 +94,11 @@
this.resetLoadAndGrabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadAndGrabToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.txFilter = new System.Windows.Forms.TextBox();
this.btClearFilter = new System.Windows.Forms.Button();
this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
this.txMappingName = new System.Windows.Forms.TextBox();
this.btLoadMyMapping = new System.Windows.Forms.Button();
this.btSaveMyMapping = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.UC_JoyPanel = new SCJMapper_V2.UC_JoyPanel();
this.cmCopyPaste.SuspendLayout();
this.panel3.SuspendLayout();
@ -106,6 +111,7 @@
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.tableLayoutPanel3.SuspendLayout();
this.SuspendLayout();
//
// btDumpList
@ -121,9 +127,9 @@
// label3
//
this.label3.Dock = System.Windows.Forms.DockStyle.Fill;
this.label3.Location = new System.Drawing.Point(606, 834);
this.label3.Location = new System.Drawing.Point(606, 833);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(372, 25);
this.label3.Size = new System.Drawing.Size(372, 26);
this.label3.TabIndex = 22;
this.label3.Text = "Right click above to open the context menu";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -138,8 +144,8 @@
this.rtb.Font = new System.Drawing.Font("Lucida Console", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.rtb.Location = new System.Drawing.Point(606, 81);
this.rtb.Name = "rtb";
this.tlpanel.SetRowSpan(this.rtb, 3);
this.rtb.Size = new System.Drawing.Size(372, 750);
this.tlpanel.SetRowSpan(this.rtb, 2);
this.rtb.Size = new System.Drawing.Size(372, 674);
this.rtb.TabIndex = 21;
this.rtb.Text = "";
this.rtb.WordWrap = false;
@ -414,7 +420,7 @@
this.treeView1.Name = "treeView1";
this.tlpanel.SetRowSpan(this.treeView1, 3);
this.treeView1.SelectedImageKey = "Selected";
this.treeView1.Size = new System.Drawing.Size(294, 750);
this.treeView1.Size = new System.Drawing.Size(294, 749);
this.treeView1.TabIndex = 16;
this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect);
//
@ -498,7 +504,7 @@
// buttonExit
//
this.buttonExit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonExit.Location = new System.Drawing.Point(171, 21);
this.buttonExit.Location = new System.Drawing.Point(171, 42);
this.buttonExit.Name = "buttonExit";
this.buttonExit.Size = new System.Drawing.Size(120, 24);
this.buttonExit.TabIndex = 13;
@ -536,6 +542,7 @@
this.tlpanel.Controls.Add(this.flowLayoutPanel1, 1, 1);
this.tlpanel.Controls.Add(this.tableLayoutPanel1, 1, 2);
this.tlpanel.Controls.Add(this.tableLayoutPanel2, 1, 3);
this.tlpanel.Controls.Add(this.tableLayoutPanel3, 2, 3);
this.tlpanel.Dock = System.Windows.Forms.DockStyle.Fill;
this.tlpanel.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tlpanel.Location = new System.Drawing.Point(0, 0);
@ -544,8 +551,8 @@
this.tlpanel.RowCount = 5;
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 540F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 65F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 35F));
this.tlpanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
this.tlpanel.Size = new System.Drawing.Size(984, 862);
this.tlpanel.TabIndex = 25;
@ -570,8 +577,8 @@
this.tableLayoutPanel1.Controls.Add(this.btDump, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.btGrab, 1, 0);
this.tableLayoutPanel1.Controls.Add(this.btDumpList, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.txFilter, 0, 3);
this.tableLayoutPanel1.Controls.Add(this.btClearFilter, 0, 4);
this.tableLayoutPanel1.Controls.Add(this.txFilter, 0, 2);
this.tableLayoutPanel1.Controls.Add(this.btClearFilter, 0, 3);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayoutPanel1.Location = new System.Drawing.Point(306, 621);
@ -582,9 +589,29 @@
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(294, 156);
this.tableLayoutPanel1.Size = new System.Drawing.Size(294, 134);
this.tableLayoutPanel1.TabIndex = 23;
//
// txFilter
//
this.txFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.txFilter.Location = new System.Drawing.Point(3, 67);
this.txFilter.Name = "txFilter";
this.txFilter.Size = new System.Drawing.Size(120, 20);
this.txFilter.TabIndex = 25;
this.txFilter.WordWrap = false;
this.txFilter.TextChanged += new System.EventHandler(this.txFilter_TextChanged);
//
// btClearFilter
//
this.btClearFilter.Location = new System.Drawing.Point(3, 93);
this.btClearFilter.Name = "btClearFilter";
this.btClearFilter.Size = new System.Drawing.Size(120, 24);
this.btClearFilter.TabIndex = 26;
this.btClearFilter.Text = "Clear Filter";
this.btClearFilter.UseVisualStyleBackColor = true;
this.btClearFilter.Click += new System.EventHandler(this.btClearFilter_Click);
//
// tableLayoutPanel2
//
this.tableLayoutPanel2.ColumnCount = 2;
@ -593,13 +620,13 @@
this.tableLayoutPanel2.Controls.Add(this.buttonExit, 1, 1);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayoutPanel2.Location = new System.Drawing.Point(306, 783);
this.tableLayoutPanel2.Location = new System.Drawing.Point(306, 761);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 2;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(294, 48);
this.tableLayoutPanel2.Size = new System.Drawing.Size(294, 69);
this.tableLayoutPanel2.TabIndex = 24;
//
// statusStrip1
@ -745,24 +772,65 @@
this.loadToolStripMenuItem.Text = "Load !";
this.loadToolStripMenuItem.Click += new System.EventHandler(this.loadToolStripMenuItem_Click);
//
// txFilter
//
this.txFilter.Location = new System.Drawing.Point(3, 93);
this.txFilter.Name = "txFilter";
this.txFilter.Size = new System.Drawing.Size(120, 20);
this.txFilter.TabIndex = 25;
this.txFilter.WordWrap = false;
this.txFilter.TextChanged += new System.EventHandler(this.txFilter_TextChanged);
//
// btClearFilter
//
this.btClearFilter.Location = new System.Drawing.Point(3, 123);
this.btClearFilter.Name = "btClearFilter";
this.btClearFilter.Size = new System.Drawing.Size(120, 24);
this.btClearFilter.TabIndex = 26;
this.btClearFilter.Text = "Clear Filter";
this.btClearFilter.UseVisualStyleBackColor = true;
this.btClearFilter.Click += new System.EventHandler(this.btClearFilter_Click);
// tableLayoutPanel3
//
this.tableLayoutPanel3.ColumnCount = 2;
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 240F));
this.tableLayoutPanel3.Controls.Add(this.btSaveMyMapping, 1, 1);
this.tableLayoutPanel3.Controls.Add(this.btLoadMyMapping, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.txMappingName, 1, 0);
this.tableLayoutPanel3.Controls.Add(this.label1, 0, 0);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.GrowStyle = System.Windows.Forms.TableLayoutPanelGrowStyle.FixedSize;
this.tableLayoutPanel3.Location = new System.Drawing.Point(606, 761);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 2;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(372, 69);
this.tableLayoutPanel3.TabIndex = 25;
//
// txMappingName
//
this.txMappingName.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.txMappingName.CharacterCasing = System.Windows.Forms.CharacterCasing.Lower;
this.txMappingName.Location = new System.Drawing.Point(135, 9);
this.txMappingName.Name = "txMappingName";
this.txMappingName.Size = new System.Drawing.Size(234, 20);
this.txMappingName.TabIndex = 0;
this.txMappingName.WordWrap = false;
this.txMappingName.TextChanged += new System.EventHandler(this.txMappingName_TextChanged);
//
// btLoadMyMapping
//
this.btLoadMyMapping.Location = new System.Drawing.Point(3, 42);
this.btLoadMyMapping.Name = "btLoadMyMapping";
this.btLoadMyMapping.Size = new System.Drawing.Size(120, 24);
this.btLoadMyMapping.TabIndex = 14;
this.btLoadMyMapping.Text = "Load my Mapping";
this.btLoadMyMapping.Visible = false;
this.btLoadMyMapping.Click += new System.EventHandler(this.btLoadMyMapping_Click);
//
// btSaveMyMapping
//
this.btSaveMyMapping.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btSaveMyMapping.Location = new System.Drawing.Point(191, 42);
this.btSaveMyMapping.Name = "btSaveMyMapping";
this.btSaveMyMapping.Size = new System.Drawing.Size(178, 24);
this.btSaveMyMapping.TabIndex = 15;
this.btSaveMyMapping.Text = "Dump and Save my Mapping";
this.btSaveMyMapping.Click += new System.EventHandler(this.btSaveMyMapping_Click);
//
// label1
//
this.label1.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(49, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(80, 13);
this.label1.TabIndex = 16;
this.label1.Text = "Mapping name:";
//
// UC_JoyPanel
//
@ -799,6 +867,8 @@
this.tableLayoutPanel2.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.tableLayoutPanel3.ResumeLayout(false);
this.tableLayoutPanel3.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -868,6 +938,11 @@
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel3;
private System.Windows.Forms.Button btClearFilter;
private System.Windows.Forms.TextBox txFilter;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel3;
private System.Windows.Forms.Button btSaveMyMapping;
private System.Windows.Forms.Button btLoadMyMapping;
private System.Windows.Forms.TextBox txMappingName;
private System.Windows.Forms.Label label1;
}
}

@ -46,6 +46,13 @@ namespace SCJMapper_V2
}
private void LoadMappingDD( )
{
tsDDbtMappings.DropDownItems.Clear( );
foreach ( String s in SCMappings.MappingNames ) {
tsDDbtMappings.DropDownItems.Add( Path.GetFileNameWithoutExtension( s ) );
}
}
/// <summary>
/// Handle the load event
@ -75,15 +82,27 @@ namespace SCJMapper_V2
tsDDbtProfiles.Text = m_AppSettings.DefProfileName;
// load mappings
foreach ( String s in SCMappings.MappingNames ) {
tsDDbtMappings.DropDownItems.Add( Path.GetFileNameWithoutExtension( s ) );
}
LoadMappingDD( );
tsDDbtMappings.Text = m_AppSettings.DefMappingName;
// load other defaults
txMappingName.Text = m_AppSettings.MyMappingName;
// Init X things
if ( !InitDirectInput( ) )
Close( );
if ( SCMappings.MappingFileExists( txMappingName.Text ) ) {
rtb.LoadFile( SCMappings.MappingFileName( txMappingName.Text ), RichTextBoxStreamType.PlainText );
InitActionTree( false );
Grab( );
m_AppSettings.MyMappingName = txMappingName.Text; // last used - persist
txMappingName.BackColor = MyColors.SuccessColor;
}
else {
txMappingName.BackColor = MyColors.ErrorColor;
}
// poll the XInput
timer1.Start( ); // this one polls the joysticks to show the props
}
@ -257,7 +276,7 @@ namespace SCJMapper_V2
/// <summary>
/// Grab the rtb data and load them into config
/// </summary>
private void Grab ()
private void Grab( )
{
m_AT.ActionMaps.fromXML( rtb.Text );
m_AT.ReloadCtrl( );
@ -385,7 +404,7 @@ namespace SCJMapper_V2
tsDDbtProfiles.Text = e.ClickedItem.Text;
m_AppSettings.DefProfileName = e.ClickedItem.Text;
m_AppSettings.Save( );
// InitActionTree( ( Settings.Default.ResetMode == Settings.Default.ResetModeDefault ) ); // start over
// InitActionTree( ( Settings.Default.ResetMode == Settings.Default.ResetModeDefault ) ); // start over
}
private void resetEmptyToolStripMenuItem_Click( object sender, EventArgs e )
@ -413,14 +432,22 @@ namespace SCJMapper_V2
private void loadToolStripMenuItem_Click( object sender, EventArgs e )
{
rtb.Text = SCMappings.Mapping( m_AppSettings.DefMappingName );
if ( SCMappings.IsUserMapping( m_AppSettings.DefMappingName ) ) {
txMappingName.Text = m_AppSettings.DefMappingName;
}
btGrab.BackColor = MyColors.DirtyColor;
txMappingName.BackColor = MyColors.ValidColor;
}
private void loadAndGrabToolStripMenuItem_Click( object sender, EventArgs e )
{
rtb.Text = SCMappings.Mapping( m_AppSettings.DefMappingName );
Grab( );
if ( SCMappings.IsUserMapping( m_AppSettings.DefMappingName ) ) {
txMappingName.Text = m_AppSettings.DefMappingName;
}
btDump.BackColor = MyColors.DirtyColor;
txMappingName.BackColor = MyColors.ValidColor;
}
private void resetLoadAndGrabToolStripMenuItem_Click( object sender, EventArgs e )
@ -428,7 +455,11 @@ namespace SCJMapper_V2
// start over
InitActionTree( false );
rtb.Text = SCMappings.Mapping( m_AppSettings.DefMappingName );
if ( SCMappings.IsUserMapping( m_AppSettings.DefMappingName ) ) {
txMappingName.Text = m_AppSettings.DefMappingName;
}
Grab( );
txMappingName.BackColor = MyColors.ValidColor;
}
private void defaultsLoadAndGrabToolStripMenuItem_Click( object sender, EventArgs e )
@ -437,12 +468,16 @@ namespace SCJMapper_V2
InitActionTree( true );
rtb.Text = SCMappings.Mapping( m_AppSettings.DefMappingName );
Grab( );
if ( SCMappings.IsUserMapping( m_AppSettings.DefMappingName ) ) {
txMappingName.Text = m_AppSettings.DefMappingName;
}
btDump.BackColor = MyColors.DirtyColor;
txMappingName.BackColor = MyColors.ValidColor;
}
// Context Menu Items
private void tsiCopy_Click( object sender, EventArgs e )
{
rtb.Focus( );
@ -523,10 +558,57 @@ namespace SCJMapper_V2
{
// Loads the file into the control.
string[] droppedFilenames = e.Data.GetData( DataFormats.FileDrop, true ) as string[];
if ( droppedFilenames.Length > 0 ) rtb.LoadFile( droppedFilenames[0], System.Windows.Forms.RichTextBoxStreamType.PlainText );
if ( droppedFilenames.Length > 0 ) rtb.LoadFile( droppedFilenames[0], RichTextBoxStreamType.PlainText );
}
// XML load and save
private void btLoadMyMapping_Click( object sender, EventArgs e )
{
if ( SCMappings.MappingFileExists( txMappingName.Text ) ) {
rtb.LoadFile( SCMappings.MappingFileName( txMappingName.Text ), RichTextBoxStreamType.PlainText );
InitActionTree( false );
Grab( );
m_AppSettings.MyMappingName = txMappingName.Text; // last used - persist
txMappingName.BackColor = MyColors.SuccessColor;
}
else {
txMappingName.BackColor = MyColors.ErrorColor;
}
}
private void btSaveMyMapping_Click( object sender, EventArgs e )
{
Boolean cancel = false;
if ( SCMappings.IsValidMappingName( txMappingName.Text ) ) {
Dump( );
if ( SCMappings.MappingFileExists( txMappingName.Text ) ) {
cancel = ( MessageBox.Show( "File exists, shall we overwrite ?", "Save XML", MessageBoxButtons.YesNo ) == System.Windows.Forms.DialogResult.No);
}
if ( !cancel ) {
rtb.SaveFile( SCMappings.MappingFileName( txMappingName.Text ), RichTextBoxStreamType.PlainText );
// get the new one into the list
SCMappings.UpdateMappingNames( );
LoadMappingDD( );
m_AppSettings.MyMappingName = txMappingName.Text; // last used - persist
txMappingName.BackColor = MyColors.SuccessColor;
}
}
else {
txMappingName.BackColor = MyColors.ErrorColor;
}
}
private void txMappingName_TextChanged( object sender, EventArgs e )
{
if ( SCMappings.IsValidMappingName( txMappingName.Text ) ) {
txMappingName.BackColor = MyColors.ValidColor;
}
else {
txMappingName.BackColor = MyColors.InvalidColor;
}
}
#endregion
@ -536,5 +618,6 @@ namespace SCJMapper_V2
}
}

@ -392,7 +392,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAQ
DgAAAk1TRnQBSQFMAgEBBwEAAaABBwGgAQcBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DgAAAk1TRnQBSQFMAgEBBwEAARgBCAEYAQgBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAASADAAEBAQABCAYAAQgYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -470,34 +470,34 @@
<data name="tsDDbtProfiles.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBOR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ba
41PVglCJ4iX61Yc8wWKxXlmZKBdqi8xT6GcTZ6DznZeJgfiBod7LYwYOkqXuP9FjK7c0/5hHNY2wDfWj
xMAaWm4/+j7om2Zt27On68COE/sOtlvzTE19+Zt37VMb68NpyWNg0qTfAMNRcESuwBziAAAAAElFTkSu
QmCC
</value>
</data>
<data name="tsBtReset.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -553,22 +553,22 @@
<data name="tsBtLoad.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAOHSURBVGhD7ZhbSFNxHMd9KbOy7G5oo0y01AoTorforbce
I+1KKFIPUbYyJUkSDcuIbjpHCxtENIvuEs4ig6CbU1Rsc+rUOXXeNhHv+e3/+++Q6MlLZvMf7Asf9vA7
HL+fnfObnOPliSeeeCJGsrOzA3JyctJUKpWVgWnQy3jI2CWdYu7CSijUajVKSkrQ09OD6WRoaAhmsxka
jQZMfI90qrkJ+/YzDAYDLzY8PIzu7m44HI4JcTqd6O/v58dbLBYSeCadam7CBOytra0YGBhAV1fXtOnt
7eWyWq2WbimFdDr3h/1xXoi+2fElp2JkZAQ6nW78fswmVtpN2lGprjx0YGdn54z416GdpN2kHWU9f3+V
/0bgX0L7Njg4yEVoR2lXpcpjQwIdHR1u59UnA/ZlabD8yHksjFFOif/u/T98opVpPodOjb2dSKC9vd2t
5H/4jMVHkxFaVIodzkHs7MOURNkcWP9Aj0WHErHg4LnR24kE2tra3MreDBWCdZWILAe2FHcjXG9HeGHr
hEQUtWPLxz5EVgKKnLdgV2L0dnK3QJmpBkviLrnKvetA2BvbtIkodiL0eS3mxyTYpfouAbvd7jaKyyqx
9MRlbH7d+OcUNPFP2gmpvkuA/pG5i+J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Mnp/escp077gTY28nEmhvb3cr
eZ8+Y+mRVIQVlmOncxC7+jAl0TYHgh7rsSTuDBYfPD16O5FAW1ubW9mboUKIrhLbvwNbiroRqbcjsqB1
QqIK27GluA/bKwFF9nuwKzF6O7lb4JupBssSLrnKfehAxDvbtIkqciLsRS0W7k+xS/VdAna73W0UfauE
3/Er2Pym8e9528Q/aSek+i4B+kfmLorKJYGXlhkjE2hpaflNudEM5YM8BB9LG/MrMJv4J2Wy+74N4c/M
M4LOIdV3CTQ3N3NKq0x8yxVqPbZ9dyC6gW3/LLOjDtj6FYhgOxCW/2NGTCiQfF+HgBsvEMmWJfyVBaF5
VQh9UiEcMgGbzcYJTLiA4IclCH1qRMhjg7DIBJqamjg02PToCzZpS12fgiITsFqtHBoEa4qFRybQ2NjI
ocHGnI/CIxNoaGjg0CDonl54ZAL19fUcGihuvRWeSQU2sJ9R0ZEJ0MM5QYPAq/nCIxOoq6vj0CDgcq7w
yARqa2s5NFifphUemUBNTQ2HBuvOa4RnUoG151TCIxOg14QEDdacuis8MoHq6moODVYn3xQemYDJZOLQ
YFXSdeGZVGAle9wTnTEC9HK3oqICRqORD1YkpgvPeIGMgoICLhAQfx7+8RexPCFNWKjf+NcqipycHOj1
eiTefgjfQ+fgf/SCsFA/79iTV6X6rqjV6hAmknn52h07XR5f9mDvd5iJHEkVBupDvajfogMpG6Xq8iw6
cCbEJ1aZuSBW2UwHiwLvw3pRP6mqJ5548n/Hy+sXyosZGEFfmaMAAAAASUVORK5CYII=
</value>
</data>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

@ -12,5 +12,11 @@ namespace SCJMapper_V2
{
static public Color[] JColor = { Color.LightGreen, Color.LightBlue, Color.Khaki, Color.LightSalmon, Color.Beige, Color.Yellow, Color.Plum, Color.Lavender };
static public Color DirtyColor = Color.Tomato;
static public Color SuccessColor = Color.GreenYellow;
static public Color ValidColor = Color.White;
static public Color InvalidColor = Color.Tomato;
static public Color ErrorColor = Color.Gold;
}
}

@ -12,6 +12,68 @@ namespace SCJMapper_V2
/// </summary>
class SCMappings
{
private const String c_UserMapStartsWith = "layout_my_"; // we only allow those mapping names
static private List<String> m_scMappings = new List<string>( );
/// <summary>
/// Returns true if a mapping file exists
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>True if the file exists</returns>
static public Boolean MappingFileExists( String mapName )
{
Boolean retVal = false;
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
retVal = File.Exists( Path.Combine( SCPath.SCClientMappingPath, mapName + ".xml" ) );
}
return retVal;
}
/// <summary>
/// Returns the mapping file name + path into our user MAPPING dir (TODO possibly to change??)
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>A fully qualified filename</returns>
static public String MappingFileName( String mapName )
{
return Path.Combine( SCPath.SCClientMappingPath, mapName + ".xml" );
}
/// <summary>
/// Returns true if a mapping name is considered a user mapping
/// </summary>
/// <param name="mapName">The mapping name</param>
/// <returns>True if it is a user mapping name</returns>
static public Boolean IsUserMapping( String mapName )
{
return mapName.StartsWith( c_UserMapStartsWith );
}
/// <summary>
/// Check if we may use that name - we allow only names like "layout_my_XYZ"
/// </summary>
/// <param name="mapName">A map name</param>
/// <returns>True if valid</returns>
static public Boolean IsValidMappingName( String mapName )
{
Boolean retVal = true; // for now
retVal &= mapName.StartsWith( c_UserMapStartsWith );
retVal &= ( mapName.IndexOfAny( new char[] { ' ', '\t', '\n', '\r', '\0' } ) < 0 ); // make sure we don't have spaces etc.
return retVal;
}
static public void UpdateMappingNames( )
{
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
m_scMappings.Clear( );
m_scMappings = ( List<String> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList( );
}
}
/// <summary>
/// Returns a list of files found
@ -21,11 +83,13 @@ namespace SCJMapper_V2
{
get
{
List<String> retVal = new List<String>( );
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
retVal = ( List<String> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList();
if ( m_scMappings.Count == 0 ) {
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
m_scMappings.Clear( );
m_scMappings = ( List<String> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList( );
}
}
return retVal;
return m_scMappings;
}
}

Loading…
Cancel
Save