Add log4net instrumentation (Win 8.1 seems to make still problems)

Compiled for AnyCPU
pull/20/head
bm98 10 years ago
parent d924956508
commit 8371532108

@ -15,7 +15,9 @@ namespace SCJMapper_V2
{ {
public partial class MainForm : Form public partial class MainForm : Form
{ {
private const String c_GithubLink = "https://github.com/bm98/SCJMapper-V2/releases"; private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private const String c_GithubLink = @"https://github.com/SCToolsfactory/SCJMapper-V2/releases";
private AppSettings m_AppSettings = new AppSettings( ); private AppSettings m_AppSettings = new AppSettings( );
@ -63,42 +65,53 @@ namespace SCJMapper_V2
/// <param name="e"></param> /// <param name="e"></param>
private void MainForm_Load( object sender, System.EventArgs e ) private void MainForm_Load( object sender, System.EventArgs e )
{ {
log.Debug( "MainForm_Load - Entry" );
// some applic initialization // some applic initialization
// Assign Size property, since databinding to Size doesn't work well. // Assign Size property, since databinding to Size doesn't work well.
this.Size = m_AppSettings.FormSize; this.Size = m_AppSettings.FormSize;
this.Location = m_AppSettings.FormLocation; this.Location = m_AppSettings.FormLocation;
// XML RTB
rtb.SelectionTabs = new int[] { 10, 20, 30, 40, 50, 60 }; // short tabs
rtb.DragEnter += new DragEventHandler( rtb_DragEnter );
rtb.DragDrop += new DragEventHandler( rtb_DragDrop );
rtb.AllowDrop = true; // add Drop to rtb
String version = Application.ProductVersion; // get the version information String version = Application.ProductVersion; // get the version information
lblTitle.Text += " - V " + version.Substring( 0, version.IndexOf( ".", version.IndexOf( "." ) + 1 ) ); // get the first two elements lblTitle.Text += " - V " + version.Substring( 0, version.IndexOf( ".", version.IndexOf( "." ) + 1 ) ); // get the first two elements
// tooltips where needed // tooltips where needed
toolTip1.SetToolTip( this.linkLblReleases, c_GithubLink ); // allow to see where the link may head toolTip1.SetToolTip( this.linkLblReleases, c_GithubLink ); // allow to see where the link may head
// XML RTB
log.Debug( "Loading RTB" );
rtb.SelectionTabs = new int[] { 10, 20, 30, 40, 50, 60 }; // short tabs
rtb.DragEnter += new DragEventHandler( rtb_DragEnter );
rtb.DragDrop += new DragEventHandler( rtb_DragDrop );
rtb.AllowDrop = true; // add Drop to rtb
// load profiles // load profiles
log.Debug( "Loading Profiles" );
foreach ( String s in SCDefaultProfile.DefaultProfileNames ) { foreach ( String s in SCDefaultProfile.DefaultProfileNames ) {
tsDDbtProfiles.DropDownItems.Add( Path.GetFileNameWithoutExtension( s ) ); tsDDbtProfiles.DropDownItems.Add( Path.GetFileNameWithoutExtension( s ) );
} }
tsDDbtProfiles.Text = m_AppSettings.DefProfileName; tsDDbtProfiles.Text = m_AppSettings.DefProfileName;
// load mappings // load mappings
log.Debug( "Loading Mappings" );
LoadMappingDD( ); LoadMappingDD( );
tsDDbtMappings.Text = m_AppSettings.DefMappingName; tsDDbtMappings.Text = m_AppSettings.DefMappingName;
// load other defaults // load other defaults
log.Debug( "Loading Other" );
txMappingName.Text = m_AppSettings.MyMappingName; txMappingName.Text = m_AppSettings.MyMappingName;
SetRebindField( txMappingName.Text ); SetRebindField( txMappingName.Text );
// Init X things // Init X things
if ( !InitDirectInput( ) ) log.Debug( "Loading DirectX" );
if ( !InitDirectInput( ) ) {
log.Fatal( "Initializing DirectXInput failed" );
MessageBox.Show( "Initializing DirectXInput failed - program exits now", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Information );
Close( ); Close( );
}
log.Debug( "Loading last used mapping" );
if ( SCMappings.MappingFileExists( txMappingName.Text ) ) { if ( SCMappings.MappingFileExists( txMappingName.Text ) ) {
rtb.LoadFile( SCMappings.MappingFileName( txMappingName.Text ), RichTextBoxStreamType.PlainText ); rtb.LoadFile( SCMappings.MappingFileName( txMappingName.Text ), RichTextBoxStreamType.PlainText );
InitActionTree( false ); InitActionTree( false );
@ -107,10 +120,12 @@ namespace SCJMapper_V2
txMappingName.BackColor = MyColors.SuccessColor; txMappingName.BackColor = MyColors.SuccessColor;
} }
else { else {
log.WarnFormat( "Last used mapping not available ({0})", txMappingName.Text );
txMappingName.BackColor = MyColors.ErrorColor; txMappingName.BackColor = MyColors.ErrorColor;
} }
// poll the XInput // poll the XInput
log.Debug( "Start XInput polling" );
timer1.Start( ); // this one polls the joysticks to show the props timer1.Start( ); // this one polls the joysticks to show the props
} }
@ -120,6 +135,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
private void buttonExit_Click( object sender, System.EventArgs e ) private void buttonExit_Click( object sender, System.EventArgs e )
{ {
log.Debug( "Shutting down now..." );
Close( ); Close( );
} }
@ -182,8 +198,8 @@ namespace SCJMapper_V2
} }
} }
catch ( Exception Ex ) { catch ( Exception Ex ) {
log.Error( "Ex DrawItem", Ex );
MessageBox.Show( Ex.Message.ToString( ), "Error Occured", MessageBoxButtons.OK, MessageBoxIcon.Information ); MessageBox.Show( Ex.Message.ToString( ), "Error Occured", MessageBoxButtons.OK, MessageBoxIcon.Information );
} }
} }
@ -195,6 +211,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
private void InitActionTree( Boolean addDefaultBinding ) private void InitActionTree( Boolean addDefaultBinding )
{ {
log.Debug( "InitActionTree - Entry" );
// build TreeView and the ActionMaps // build TreeView and the ActionMaps
m_AT = new ActionTree( ); m_AT = new ActionTree( );
m_AT.Ctrl = treeView1; // the ActionTree owns the TreeView control m_AT.Ctrl = treeView1; // the ActionTree owns the TreeView control
@ -206,65 +224,86 @@ namespace SCJMapper_V2
if ( tc1.TabCount > 2 ) { cbJs3.SelectedIndex = 2; m_AT.ActionMaps.js3 = cbJs3.Text; } if ( tc1.TabCount > 2 ) { cbJs3.SelectedIndex = 2; m_AT.ActionMaps.js3 = cbJs3.Text; }
} }
/// <summary> /// <summary>
/// Aquire the DInput joystick devices /// Aquire the DInput joystick devices
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public bool InitDirectInput( ) public bool InitDirectInput( )
{ {
log.Debug( "Entry" );
// Enumerate joysticks in the system. // Enumerate joysticks in the system.
int tabs = 0; int tabs = 0;
cbJs1.Items.Clear( ); cbJs2.Items.Clear( ); cbJs3.Items.Clear( ); // JS dropdowns init cbJs1.Items.Clear( ); cbJs2.Items.Clear( ); cbJs3.Items.Clear( ); // JS dropdowns init
// Initialize DirectInput try {
var directInput = new DirectInput( ); // Initialize DirectInput
log.Debug( "Instantiate DirectInput" );
var directInput = new DirectInput( );
// scan the Input for attached devices
log.Debug( "Scan GameControl devices" );
foreach ( DeviceInstance instance in directInput.GetDevices( DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly ) ) {
// Create the device interface
log.Debug( "Create the device interface" );
Joystick jsDevice = new Joystick( directInput, instance.InstanceGuid );
JoystickCls js = null;
log.DebugFormat( "Create the device interface for: {0}", jsDevice.Information.ProductName );
// we have the first tab made as reference so TabPage[0] already exists
if ( tabs == 0 ) {
// first panel - The Tab content exists already
log.Debug( "Add first Joystick panel" );
js = new JoystickCls( jsDevice, this, UC_JoyPanel ); // does all device related activities for that particular item
}
else {
log.Debug( "Add next Joystick panel" );
// setup the further tab contents along the reference one in TabPage[0] (the control named UC_JoyPanel)
tc1.TabPages.Add( "Joystick " + ( tabs + 1 ).ToString( ) );
UC_JoyPanel uUC_JoyPanelNew = new UC_JoyPanel( );
tc1.TabPages[tabs].Controls.Add( uUC_JoyPanelNew );
uUC_JoyPanelNew.Size = UC_JoyPanel.Size;
uUC_JoyPanelNew.Location = UC_JoyPanel.Location;
log.Debug( "Create Joystick instance" );
js = new JoystickCls( jsDevice, this, uUC_JoyPanelNew ); // does all device related activities for that particular item
}
m_JS.Add( js ); // add to joystick list
// scan the Input for attached devices tc1.TabPages[tabs].Tag = js.DevName; // used to find the tab via JS mapping
foreach ( DeviceInstance instance in directInput.GetDevices( DeviceClass.GameControl, DeviceEnumerationFlags.AttachedOnly ) ) { tc1.TabPages[tabs].BackColor = MyColors.JColor[tabs]; // each tab has its own color
cbJs1.Items.Add( js.DevName ); cbJs2.Items.Add( js.DevName ); cbJs3.Items.Add( js.DevName ); // populate DropDowns with the JS name
// Create the device interface // next tab
Joystick jsDevice = new Joystick( directInput, instance.InstanceGuid ); tabs++;
JoystickCls js = null; if ( tabs == 8 ) break; // cannot load more JSticks than predefined Tabs
}
log.DebugFormat( "Added {0} GameControl devices", tabs );
// we have the first tab made as reference so TabPage[0] already exists /*
if ( tabs == 0 ) { // TEST CREATE ALL 8 TABS
// first panel - The Tab content exists already for ( int i=(tabs+1); i < 9; i++ ) {
js = new JoystickCls( jsDevice, this, UC_JoyPanel ); // does all device related activities for that particular item tc1.TabPages.Add( "Joystick " + i.ToString( ) );
} }
else { */
// setup the further tab contents along the reference one in TabPage[0] (the control named UC_JoyPanel)
tc1.TabPages.Add( "Joystick " + ( tabs + 1 ).ToString( ) ); if ( tabs == 0 ) {
UC_JoyPanel uUC_JoyPanelNew = new UC_JoyPanel( ); log.Warn( "Unable to find and/or create any joystick devices." );
tc1.TabPages[tabs].Controls.Add( uUC_JoyPanelNew ); MessageBox.Show( "Unable to create a joystick device. Program will exit.", "No joystick found", MessageBoxButtons.OK, MessageBoxIcon.Information );
uUC_JoyPanelNew.Size = UC_JoyPanel.Size; return false;
uUC_JoyPanelNew.Location = UC_JoyPanel.Location;
js = new JoystickCls( jsDevice, this, uUC_JoyPanelNew ); // does all device related activities for that particular item
} }
m_JS.Add( js ); // add to joystick list
tc1.TabPages[tabs].Tag = js.DevName; // used to find the tab via JS mapping // load the profile items from the XML
tc1.TabPages[tabs].BackColor = MyColors.JColor[tabs]; // each tab has its own color log.Debug( "Init ActionTree" );
cbJs1.Items.Add( js.DevName ); cbJs2.Items.Add( js.DevName ); cbJs3.Items.Add( js.DevName ); // populate DropDowns with the JS name InitActionTree( true );
// next tab
tabs++;
if ( tabs == 8 ) break; // cannot load more JSticks than predefined Tabs
}
/*
// TEST CREATE ALL 8 TABS
for ( int i=(tabs+1); i < 9; i++ ) {
tc1.TabPages.Add( "Joystick " + i.ToString( ) );
} }
*/ catch ( Exception ex ) {
log.Debug( "InitDirectInput failed unexpetedly", ex );
if ( tabs == 0 ) {
MessageBox.Show( "Unable to create a joystick device. Program will exit.", "No joystick found" );
return false; return false;
} }
// load the profile items from the XML
InitActionTree( true );
return true; return true;
} }
@ -289,6 +328,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
private void Grab( ) private void Grab( )
{ {
log.Debug( "Grab - Entry" );
m_AT.ActionMaps.fromXML( rtb.Text ); m_AT.ActionMaps.fromXML( rtb.Text );
m_AT.ReloadCtrl( ); m_AT.ReloadCtrl( );
// JS mapping for the first 3 items can be changed and reloaded from XML // JS mapping for the first 3 items can be changed and reloaded from XML
@ -314,6 +355,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
private void Dump( ) private void Dump( )
{ {
log.Debug( "Dump - Entry" );
rtb.Text = String.Format( "<!-- {0} - SC Joystick Mapping -->\n{1}", DateTime.Now, m_AT.ActionMaps.toXML( ) ); rtb.Text = String.Format( "<!-- {0} - SC Joystick Mapping -->\n{1}", DateTime.Now, m_AT.ActionMaps.toXML( ) );
btDump.BackColor = btClear.BackColor; btDump.UseVisualStyleBackColor = btClear.UseVisualStyleBackColor; // neutral again btDump.BackColor = btClear.BackColor; btDump.UseVisualStyleBackColor = btClear.UseVisualStyleBackColor; // neutral again
@ -333,6 +376,8 @@ namespace SCJMapper_V2
private void MainForm_FormClosing( object sender, FormClosingEventArgs e ) private void MainForm_FormClosing( object sender, FormClosingEventArgs e )
{ {
log.Debug( "MainForm_FormClosing - Entry" );
m_AppSettings.FormSize = this.Size; m_AppSettings.FormSize = this.Size;
m_AppSettings.FormLocation = this.Location; m_AppSettings.FormLocation = this.Location;
m_AppSettings.Save( ); m_AppSettings.Save( );

@ -15,6 +15,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class ActionCls class ActionCls
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
// Static items to have this mapping in only one place // Static items to have this mapping in only one place
/// <summary> /// <summary>

@ -20,6 +20,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class ActionMapCls : List<ActionCls> class ActionMapCls : List<ActionCls>
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
public String name { get; set; } public String name { get; set; }

@ -20,6 +20,9 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class ActionMapsCls : List<ActionMapCls> class ActionMapsCls : List<ActionMapCls>
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
public String version { get; set; } public String version { get; set; }
// own additions for JS mapping - should not harm.. // own additions for JS mapping - should not harm..
public String js1 { get; set; } public String js1 { get; set; }
@ -47,6 +50,8 @@ namespace SCJMapper_V2
/// <param name="newAcm"></param> /// <param name="newAcm"></param>
private void Merge( ActionMapCls newAcm ) private void Merge( ActionMapCls newAcm )
{ {
log.Debug( "Merge - Entry" );
// do we find an actionmap like the new one in our list ? // do we find an actionmap like the new one in our list ?
ActionMapCls ACM = this.Find( delegate( ActionMapCls acm ) { ActionMapCls ACM = this.Find( delegate( ActionMapCls acm ) {
return acm.name == newAcm.name; return acm.name == newAcm.name;
@ -66,7 +71,9 @@ namespace SCJMapper_V2
/// <returns>the action as XML fragment</returns> /// <returns>the action as XML fragment</returns>
public String toXML( ) public String toXML( )
{ {
String r = String.Format( "<ActionMaps version=\"{0}\" ", version); log.Debug( "toXML - Entry" );
String r = String.Format( "<ActionMaps version=\"{0}\" ", version );
if ( !String.IsNullOrEmpty( js1 ) ) r += String.Format( "js1=\"{0}\" ", js1 ); if ( !String.IsNullOrEmpty( js1 ) ) r += String.Format( "js1=\"{0}\" ", js1 );
if ( !String.IsNullOrEmpty( js2 ) ) r += String.Format( "js2=\"{0}\" ", js2 ); if ( !String.IsNullOrEmpty( js2 ) ) r += String.Format( "js2=\"{0}\" ", js2 );
if ( !String.IsNullOrEmpty( js3 ) ) r += String.Format( "js3=\"{0}\" ", js3 ); if ( !String.IsNullOrEmpty( js3 ) ) r += String.Format( "js3=\"{0}\" ", js3 );
@ -92,6 +99,8 @@ namespace SCJMapper_V2
/// <returns>True if an action was decoded</returns> /// <returns>True if an action was decoded</returns>
public Boolean fromXML( String xml ) public Boolean fromXML( String xml )
{ {
log.Debug( "fromXML - Entry" );
XmlReaderSettings settings = new XmlReaderSettings( ); XmlReaderSettings settings = new XmlReaderSettings( );
settings.ConformanceLevel = ConformanceLevel.Fragment; settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.IgnoreWhitespace = true; settings.IgnoreWhitespace = true;

@ -14,6 +14,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class ActionTree class ActionTree
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
public ActionMapsCls ActionMaps { get; set; } // the Action Maps and Actions public ActionMapsCls ActionMaps { get; set; } // the Action Maps and Actions
@ -59,6 +60,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
private void ApplyFilter( ) private void ApplyFilter( )
{ {
log.Debug( "ApplyFilter - Entry" );
TreeNode topNode = null; // allow to backup the view - will carry the first node items TreeNode topNode = null; // allow to backup the view - will carry the first node items
Ctrl.BeginUpdate( ); Ctrl.BeginUpdate( );
@ -126,6 +129,8 @@ namespace SCJMapper_V2
/// <param name="applyDefaults">True if default mappings should be carried on</param> /// <param name="applyDefaults">True if default mappings should be carried on</param>
public void LoadTree( String defaultProfileName, Boolean applyDefaults ) public void LoadTree( String defaultProfileName, Boolean applyDefaults )
{ {
log.Debug( "LoadTree - Entry" );
TreeNode tn = null; TreeNode tn = null;
TreeNode[] cnl = { }; TreeNode[] cnl = { };
TreeNode cn = null; TreeNode cn = null;
@ -218,6 +223,8 @@ namespace SCJMapper_V2
/// <param name="input">The new Text property</param> /// <param name="input">The new Text property</param>
public void UpdateSelectedItem( String input ) public void UpdateSelectedItem( String input )
{ {
log.Debug( "UpdateSelectedItem - Entry" );
if ( Ctrl.SelectedNode == null ) return; if ( Ctrl.SelectedNode == null ) return;
// applies only to ActionNodes // applies only to ActionNodes
@ -262,6 +269,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
public void ReloadCtrl( ) public void ReloadCtrl( )
{ {
log.Debug( "ReloadCtrl - Entry" );
foreach ( ActionMapCls acm in ActionMaps ) { foreach ( ActionMapCls acm in ActionMaps ) {
try { try {
TreeNode amTn = m_MasterTree.Nodes[acm.name]; // get the map node TreeNode amTn = m_MasterTree.Nodes[acm.name]; // get the map node
@ -303,6 +312,8 @@ namespace SCJMapper_V2
/// <param name="m_MasterTree">The string to find</param> /// <param name="m_MasterTree">The string to find</param>
public void FindCtrl( String ctrl ) public void FindCtrl( String ctrl )
{ {
log.Debug( "FindCtrl - Entry" );
Boolean found = false; Boolean found = false;
foreach ( TreeNode tn in Ctrl.Nodes ) { foreach ( TreeNode tn in Ctrl.Nodes ) {
// have to search nodes of nodes // have to search nodes of nodes
@ -325,6 +336,8 @@ namespace SCJMapper_V2
/// <returns></returns> /// <returns></returns>
public String ReportActions( ) public String ReportActions( )
{ {
log.Debug( "FindCtrl - ReportActions" );
String repList = ""; String repList = "";
// JS assignments // JS assignments
if ( !String.IsNullOrEmpty( ActionMaps.js1 ) ) repList += String.Format( "** js1 = {0}\n", ActionMaps.js1 ); if ( !String.IsNullOrEmpty( ActionMaps.js1 ) ) repList += String.Format( "** js1 = {0}\n", ActionMaps.js1 );

@ -11,6 +11,8 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class DProfileReader class DProfileReader
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
public Boolean ValidContent { get; set; } public Boolean ValidContent { get; set; }
private Stack<String> m_nodeNameStack = null; // element name stack - keeping track where we are private Stack<String> m_nodeNameStack = null; // element name stack - keeping track where we are
@ -29,7 +31,7 @@ namespace SCJMapper_V2
public String name { get; set; } // the action name public String name { get; set; } // the action name
public String input { get; set; } // the input method K,J,X,P public String input { get; set; } // the input method K,J,X,P
private String m_defBinding = ""; private String m_defBinding = "";
public String defBinding { get { return m_defBinding;} set { m_defBinding = value.Trim();} } // need to clean this one, found spaces... public String defBinding { get { return m_defBinding; } set { m_defBinding = value.Trim( ); } } // need to clean this one, found spaces...
public String keyName public String keyName
{ get { return input + name; } } // prep for TreView usage - create a key from input+name { get { return input + name; } } // prep for TreView usage - create a key from input+name
} }
@ -59,6 +61,8 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "CSVMap - Entry" );
String buf = ""; String buf = "";
foreach ( ActionMap am in m_aMap.Values ) { foreach ( ActionMap am in m_aMap.Values ) {
buf += am.name + ";"; buf += am.name + ";";
@ -266,6 +270,8 @@ namespace SCJMapper_V2
/// <returns></returns> /// <returns></returns>
private Boolean ReadXML( XmlReader xr ) private Boolean ReadXML( XmlReader xr )
{ {
log.Debug( "ReadXML - Entry" );
Boolean retVal = true; Boolean retVal = true;
try { try {
@ -295,8 +301,9 @@ namespace SCJMapper_V2
return false; return false;
} }
catch { catch ( Exception ex ) {
// get any exceptions from reading // get any exceptions from reading
log.Error( "ReadXML - unexpected", ex );
return false; return false;
} }
} }
@ -308,6 +315,8 @@ namespace SCJMapper_V2
/// <returns>True if an action was decoded</returns> /// <returns>True if an action was decoded</returns>
public Boolean fromXML( String xml ) public Boolean fromXML( String xml )
{ {
log.Debug( "fromXML - Entry" );
XmlReaderSettings settings = new XmlReaderSettings( ); XmlReaderSettings settings = new XmlReaderSettings( );
settings.ConformanceLevel = ConformanceLevel.Fragment; settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.IgnoreWhitespace = true; settings.IgnoreWhitespace = true;

@ -16,6 +16,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class JoystickCls class JoystickCls
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
#region Static Items #region Static Items
@ -157,6 +158,8 @@ namespace SCJMapper_V2
/// <param name="panel">The respective JS panel to show the properties</param> /// <param name="panel">The respective JS panel to show the properties</param>
public JoystickCls( Joystick device, Control hwnd, UC_JoyPanel panel ) public JoystickCls( Joystick device, Control hwnd, UC_JoyPanel panel )
{ {
log.DebugFormat( "ctor - Entry with {0}", device.Information.ProductName );
m_device = device; m_device = device;
m_hwnd = hwnd; m_hwnd = hwnd;
m_jPanel = panel; m_jPanel = panel;
@ -171,20 +174,26 @@ namespace SCJMapper_V2
m_jPanel.nButtons = ButtonCount.ToString( ); m_jPanel.nButtons = ButtonCount.ToString( );
m_jPanel.nPOVs = POVCount.ToString( ); m_jPanel.nPOVs = POVCount.ToString( );
// Set the data format to the c_dfDIJoystick pre-defined format. log.Debug( "Get JS Objects" );
//m_device.SetDataFormat( DeviceDataFormat.Joystick ); try {
// Set the cooperative level for the device. // Set the data format to the c_dfDIJoystick pre-defined format.
m_device.SetCooperativeLevel( m_hwnd, CooperativeLevel.Exclusive | CooperativeLevel.Foreground ); //m_device.SetDataFormat( DeviceDataFormat.Joystick );
// Enumerate all the objects on the device. // Set the cooperative level for the device.
foreach ( DeviceObjectInstance d in m_device.GetObjects( ) ) { m_device.SetCooperativeLevel( m_hwnd, CooperativeLevel.Exclusive | CooperativeLevel.Foreground );
// For axes that are returned, set the DIPROP_RANGE property for the // Enumerate all the objects on the device.
// enumerated axis in order to scale min/max values. foreach ( DeviceObjectInstance d in m_device.GetObjects( ) ) {
if ( ( 0 != ( d.ObjectId.Flags & DeviceObjectTypeFlags.Axis ) ) ) { // For axes that are returned, set the DIPROP_RANGE property for the
// Set the range for the axis. // enumerated axis in order to scale min/max values.
m_device.Properties.Range = new InputRange( -1000, +1000 ); if ( ( 0 != ( d.ObjectId.Flags & DeviceObjectTypeFlags.Axis ) ) ) {
// Set the range for the axis.
m_device.Properties.Range = new InputRange( -1000, +1000 );
}
// Update the controls to reflect what objects the device supports.
UpdateControls( d );
} }
// Update the controls to reflect what objects the device supports. }
UpdateControls( d ); catch ( Exception ex ) {
log.Error( "Get JS Objects failed", ex );
} }
} }
@ -194,8 +203,11 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
public void FinishDX( ) public void FinishDX( )
{ {
if ( null != m_device ) if ( null != m_device ) {
log.DebugFormat( "Release DirectInput device: {0}", m_device.Information.ProductName );
m_device.Unacquire( ); m_device.Unacquire( );
m_device = null;
}
} }
@ -414,11 +426,14 @@ namespace SCJMapper_V2
m_device.Acquire( ); m_device.Acquire( );
} }
catch ( SharpDXException ) { catch ( SharpDXException ) {
// Failed to acquire the device. // Failed to acquire the device. This could be because the app doesn't have focus.
// This could be because the app doesn't have focus. return; // EXIT unaquired
return;
} }
} }
else {
log.Error( "Unexpected Poll Exception", e );
return; // EXIT see ex code
}
} }

@ -2,20 +2,42 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using System.Configuration;
using log4net;
using log4net.Config;
//[assembly: log4net.Config.XmlConfigurator( Watch = true )]
[assembly: log4net.Config.XmlConfigurator( ConfigFile = "log4Net.config", Watch = true )]
namespace SCJMapper_V2 namespace SCJMapper_V2
{ {
static class Program static class Program
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger ( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
/* Log Levels Inc Priority
* ALL
* DEBUG
* INFO
* WARN
* ERROR
* FATAL
* OFF
* */
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main( ) static void Main( )
{ {
log.InfoFormat( "\n" );
log.InfoFormat( "SCJMapper_V2 - Started" );
Application.EnableVisualStyles( ); Application.EnableVisualStyles( );
Application.SetCompatibleTextRenderingDefault( false ); Application.SetCompatibleTextRenderingDefault( false );
Application.Run( new MainForm( ) ); Application.Run( new MainForm( ) );
log.InfoFormat( "SCJMapper_V2 - Ended\n" );
} }
} }
} }

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "2.0.0.20" )] [assembly: AssemblyVersion( "2.1.0.21" )]
[assembly: AssemblyFileVersion( "2.0.0.20" )] [assembly: AssemblyFileVersion( "2.1.0.21" )]

@ -14,6 +14,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class SCDefaultProfile class SCDefaultProfile
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
/// <summary> /// <summary>
/// Returns a list of files found that match 'defaultProfile*.xml' /// Returns a list of files found that match 'defaultProfile*.xml'
@ -23,16 +24,22 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "DefaultProfileNames - Entry" );
List<String> retVal = new List<String>( ); List<String> retVal = new List<String>( );
if ( File.Exists( SCPath.SCGameData_pak ) ) { if ( File.Exists( SCPath.SCGameData_pak ) ) {
using ( ZipFile zip = ZipFile.Read( SCPath.SCGameData_pak ) ) { using ( ZipFile zip = ZipFile.Read( SCPath.SCGameData_pak ) ) {
zip.CaseSensitiveRetrieval = false; try {
ICollection<ZipEntry> gdpak = zip.SelectEntries( "name = " + "'" + SCPath.DefaultProfileName + "*.xml'", SCPath.DefaultProfilePath_rel ); zip.CaseSensitiveRetrieval = false;
if ( gdpak != null ) { ICollection<ZipEntry> gdpak = zip.SelectEntries( "name = " + "'" + SCPath.DefaultProfileName + "*.xml'", SCPath.DefaultProfilePath_rel );
foreach ( ZipEntry ze in gdpak ) { if ( gdpak != null ) {
retVal.Add( ze.FileName ); foreach ( ZipEntry ze in gdpak ) {
retVal.Add( ze.FileName );
}
} }
} }
catch ( Exception ex ) {
log.Error( "Unexpected", ex );
}
} }
} }
return retVal; return retVal;
@ -46,47 +53,62 @@ namespace SCJMapper_V2
/// <returns>A string containing the file contents</returns> /// <returns>A string containing the file contents</returns>
static public String DefaultProfile( String defaultProfileName ) static public String DefaultProfile( String defaultProfileName )
{ {
log.Debug( "DefaultProfile - Entry" );
String retVal = ""; String retVal = "";
// first try to get the SC defaultProfile from the GameData.pak // first choice a defaultProfile.xml in the app dir distributed with the application ??? to be deleted ???
retVal = ExtractDefaultProfile( defaultProfileName ); if ( File.Exists( SCPath.DefaultProfileName + ".xml" ) ) {
if ( String.IsNullOrEmpty( retVal ) ) { using ( StreamReader sr = new StreamReader( SCPath.DefaultProfileName + ".xml" ) ) {
// second choice a defaultProfile.xml in the app dir distributed with the application ??? to be deleted ??? retVal = sr.ReadToEnd( );
if ( File.Exists( SCPath.DefaultProfileName + ".xml" ) ) { log.Info( "- Use AppDirectory defaultProfile" );
using ( StreamReader sr = new StreamReader( SCPath.DefaultProfileName + ".xml" ) ) { }
retVal = sr.ReadToEnd( ); }
} else {
// second try to get the SC defaultProfile from the GameData.pak
retVal = ExtractDefaultProfile( defaultProfileName );
if ( ! String.IsNullOrEmpty( retVal ) ) {
log.Info( "- Use GamePack defaultProfile" );
} }
// last resort is the built in one
else { else {
// last resort is the built in one
retVal = SCJMapper_V2.Properties.Resources.defaultProfile; retVal = SCJMapper_V2.Properties.Resources.defaultProfile;
log.Info( "- Use built in defaultProfile" );
} }
} }
return retVal; return retVal;
} }
/// <summary> /// <summary>
/// Zip Extracts the file to a string /// Zip Extracts the file to a string
/// </summary> /// </summary>
static private String ExtractDefaultProfile( String defaultProfileName ) static private String ExtractDefaultProfile( String defaultProfileName )
{ {
log.Debug( "ExtractDefaultProfile - Entry" );
String retVal = ""; String retVal = "";
if ( File.Exists( SCPath.SCGameData_pak ) ) { if ( File.Exists( SCPath.SCGameData_pak ) ) {
using ( ZipFile zip = ZipFile.Read( SCPath.SCGameData_pak ) ) { using ( ZipFile zip = ZipFile.Read( SCPath.SCGameData_pak ) ) {
zip.CaseSensitiveRetrieval = false; zip.CaseSensitiveRetrieval = false;
try {
ICollection<ZipEntry> gdpak = zip.SelectEntries( "name = " + "'" + defaultProfileName+"'", SCPath.DefaultProfilePath_rel ); ICollection<ZipEntry> gdpak = zip.SelectEntries( "name = " + "'" + defaultProfileName + "'", SCPath.DefaultProfilePath_rel );
if ( gdpak != null ) { if ( gdpak != null ) {
try { try {
MemoryStream mst = new MemoryStream( ); MemoryStream mst = new MemoryStream( );
gdpak.FirstOrDefault( ).Extract( mst ); gdpak.FirstOrDefault( ).Extract( mst );
UTF8Encoding unc = new UTF8Encoding( ); UTF8Encoding unc = new UTF8Encoding( );
retVal = unc.GetString( mst.ToArray( ) ); retVal = unc.GetString( mst.ToArray( ) );
} }
catch { catch {
retVal = ""; // clear any remanents retVal = ""; // clear any remanents
}
} }
} }
catch ( Exception ex ) {
log.Error( "Unexpected", ex );
}
} }
} }
return retVal; return retVal;

@ -12,6 +12,9 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class SCMappings class SCMappings
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
private const String c_UserMapStartsWith = "layout_my_"; // we only allow those mapping names private const String c_UserMapStartsWith = "layout_my_"; // we only allow those mapping names
static private List<String> m_scMappings = new List<string>( ); static private List<String> m_scMappings = new List<string>( );
@ -83,12 +86,16 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "MappingNames - Entry" );
if ( m_scMappings.Count == 0 ) { if ( m_scMappings.Count == 0 ) {
if ( Directory.Exists( SCPath.SCClientMappingPath ) ) { if ( Directory.Exists( SCPath.SCClientMappingPath ) ) {
m_scMappings.Clear( ); m_scMappings.Clear( );
m_scMappings = ( List<String> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList( ); m_scMappings = ( List<String> )Directory.EnumerateFiles( SCPath.SCClientMappingPath ).ToList( );
} }
} }
else {
log.Warn( "MappingNames - cannot find SC Mapping directory" );
}
return m_scMappings; return m_scMappings;
} }
} }

@ -12,6 +12,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class SCPath class SCPath
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
/// <summary> /// <summary>
/// Try to locate the launcher under "App Paths" /// Try to locate the launcher under "App Paths"
@ -22,8 +23,10 @@ namespace SCJMapper_V2
{ {
String scpath = ( String )Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\StarCitizen Launcher.exe", "", null ); String scpath = ( String )Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\App Paths\StarCitizen Launcher.exe", "", null );
if ( scpath != null ) { if ( scpath != null ) {
log.Info( "SCLauncherPath1 - Found HKLM - AppPath - Launcher.exe" );
return scpath; return scpath;
} }
log.Warn( "SCLauncherPath1 - did not found HKLM - AppPath - Launcher.exe" );
return ""; return "";
} }
} }
@ -37,8 +40,10 @@ namespace SCJMapper_V2
{ {
String scpath = ( String )Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\StarCitizen", "DisplayIcon", null ); String scpath = ( String )Registry.GetValue( @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\StarCitizen", "DisplayIcon", null );
if ( scpath != null ) { if ( scpath != null ) {
log.Info( "SCLauncherPath2 - Found HKLM - Uninstall - StarCitizen" );
return scpath; return scpath;
} }
log.Warn( "SCLauncherPath2 - did not found HKLM - Uninstall - StarCitizen" );
return ""; return "";
} }
} }
@ -51,6 +56,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "SCBasePath - Entry" );
String scp = SCLauncherPath1; String scp = SCLauncherPath1;
if ( String.IsNullOrEmpty( scp ) ) { if ( String.IsNullOrEmpty( scp ) ) {
scp = SCLauncherPath2; scp = SCLauncherPath2;
@ -74,6 +80,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "SCInstallPath - Entry" );
return SCBasePath; return SCBasePath;
} }
} }
@ -86,6 +93,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "SCClientDataPath - Entry" );
String scp = SCBasePath; String scp = SCBasePath;
if ( String.IsNullOrEmpty( scp ) ) return ""; if ( String.IsNullOrEmpty( scp ) ) return "";
// //
@ -103,6 +111,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "SCClientUSERPath - Entry" );
String scp = SCBasePath; String scp = SCBasePath;
if ( String.IsNullOrEmpty( scp ) ) return ""; if ( String.IsNullOrEmpty( scp ) ) return "";
// //
@ -120,6 +129,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "SCClientMappingPath - Entry" );
String scp = SCClientDataPath; String scp = SCClientDataPath;
if ( String.IsNullOrEmpty( scp ) ) return ""; if ( String.IsNullOrEmpty( scp ) ) return "";
// //
@ -137,6 +147,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "SCGameData_pak - Entry" );
String scp = SCClientDataPath; String scp = SCClientDataPath;
if ( String.IsNullOrEmpty( scp ) ) return ""; if ( String.IsNullOrEmpty( scp ) ) return "";
// //
@ -153,6 +164,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "DefaultProfilePath_rel - Entry" );
return @"Libs\Config"; return @"Libs\Config";
} }
} }
@ -164,6 +176,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "DefaultProfileName - Entry" );
return @"defaultProfile"; return @"defaultProfile";
} }
} }

@ -26,8 +26,8 @@
<UpdatePeriodically>false</UpdatePeriodically> <UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired> <UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions> <MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>20</ApplicationRevision> <ApplicationRevision>21</ApplicationRevision>
<ApplicationVersion>2.0.0.%2a</ApplicationVersion> <ApplicationVersion>2.1.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
@ -56,10 +56,34 @@
<PropertyGroup> <PropertyGroup>
<StartupObject>SCJMapper_V2.Program</StartupObject> <StartupObject>SCJMapper_V2.Program</StartupObject>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Ionic.Zip.Reduced"> <Reference Include="Ionic.Zip.Reduced">
<HintPath>packages\DotNetZip.Reduced.1.9.1.8\lib\net20\Ionic.Zip.Reduced.dll</HintPath> <HintPath>packages\DotNetZip.Reduced.1.9.1.8\lib\net20\Ionic.Zip.Reduced.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net">
<HintPath>packages\log4net.2.0.3\lib\net40-full\log4net.dll</HintPath>
</Reference>
<Reference Include="SharpDX"> <Reference Include="SharpDX">
<HintPath>$(SharpDXPackageBinDir)\SharpDX.dll</HintPath> <HintPath>$(SharpDXPackageBinDir)\SharpDX.dll</HintPath>
</Reference> </Reference>
@ -125,6 +149,9 @@
<None Include="actionList\MappingVars.csv" /> <None Include="actionList\MappingVars.csv" />
<None Include="actionList\MappingVars.xlsx" /> <None Include="actionList\MappingVars.xlsx" />
<None Include="app.config" /> <None Include="app.config" />
<None Include="log4net.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
@ -137,8 +164,8 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="defaultProfile.xml" />
<Content Include="Cassini_Logo_Icon.ico" /> <Content Include="Cassini_Logo_Icon.ico" />
<Content Include="defaultProfile.xml" />
<Content Include="graphics\Cassini_Logo2_s.jpg" /> <Content Include="graphics\Cassini_Logo2_s.jpg" />
<Content Include="graphics\Cassini_Logo_Icon.ico" /> <Content Include="graphics\Cassini_Logo_Icon.ico" />
<Content Include="graphics\invalid.png" /> <Content Include="graphics\invalid.png" />

@ -5,14 +5,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCJMapper-V2", "SCJMapper-V
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86 Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86 Release|x86 = Release|x86
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Debug|x86.ActiveCfg = Debug|x86 {B5F8B339-E02E-4F6D-BF62-D776F165910F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Debug|x86.Build.0 = Debug|x86 {B5F8B339-E02E-4F6D-BF62-D776F165910F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Release|x86.ActiveCfg = Release|x86 {B5F8B339-E02E-4F6D-BF62-D776F165910F}.Debug|x86.ActiveCfg = Debug|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Release|x86.Build.0 = Release|x86 {B5F8B339-E02E-4F6D-BF62-D776F165910F}.Debug|x86.Build.0 = Debug|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Release|Any CPU.Build.0 = Release|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Release|x86.ActiveCfg = Release|Any CPU
{B5F8B339-E02E-4F6D-BF62-D776F165910F}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

@ -12,6 +12,7 @@ namespace SCJMapper_V2
/// </summary> /// </summary>
class TheUser class TheUser
{ {
private static readonly log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod( ).DeclaringType );
/// <summary> /// <summary>
/// Returns the name of the Personal Program folder in My Documents /// Returns the name of the Personal Program folder in My Documents
@ -22,6 +23,7 @@ namespace SCJMapper_V2
{ {
get get
{ {
log.Debug( "UserDir - Entry" );
String docPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.Personal ), Application.ProductName); String docPath = Path.Combine( Environment.GetFolderPath( Environment.SpecialFolder.Personal ), Application.ProductName);
if ( !Directory.Exists( docPath ) ) Directory.CreateDirectory( docPath ); if ( !Directory.Exists( docPath ) ) Directory.CreateDirectory( docPath );
return docPath; return docPath;
@ -36,6 +38,8 @@ namespace SCJMapper_V2
/// <returns>A fully qualified filename</returns> /// <returns>A fully qualified filename</returns>
static public String MappingFileName( String mapName ) static public String MappingFileName( String mapName )
{ {
log.Debug( "MappingFileName - Entry" );
return Path.Combine( UserDir, mapName + ".xml" ); return Path.Combine( UserDir, mapName + ".xml" );
} }

@ -2,7 +2,6 @@
<configuration> <configuration>
<configSections> <configSections>
<section name="AppConfiguration" <section name="AppConfiguration"
type="SCJMapper_V2.AppConfiguration, SCJMapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" type="SCJMapper_V2.AppConfiguration, SCJMapper, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" /> allowDefinition="Everywhere" allowExeDefinition="MachineToApplication" restartOnExternalChanges="true" />
@ -15,5 +14,4 @@
<!-- This is the minimal change that detects a movement of an axis <!-- This is the minimal change that detects a movement of an axis
default is 150 - you may change it to get the detection less sensitive --> default is 150 - you may change it to get the detection less sensitive -->
<AppConfiguration jsSenseLimit="150" /> <AppConfiguration jsSenseLimit="150" />
</configuration> </configuration>

@ -0,0 +1,34 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net>
<appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="trace.log"/>
<!--Indicates whether the file should be appended to or overwritten.-->
<appendToFile value="true"/>
<!--Roll files based only on the size of the file-->
<rollingStyle value="Size"/>
<!--The maximum number of backup files that are kept before the oldest is erased.-->
<maxSizeRollBackups value="10"/>
<maximumFileSize value="500KB"/>
<!--true if always should be logged to the same file, otherwise false.-->
<staticLogFileName value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date|%-5level|%logger|%message%newline%exception"/>
</layout>
</appender>
<!-- Setup the root category, add the appenders and set the default level. -->
<root>
<level value="ALL"/> <!-- default: INFO - extensive: ALL -->
<appender-ref ref="RollingFileAppender"/>
</root>
</log4net>
</configuration>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DotNetZip.Reduced" version="1.9.1.8" targetFramework="net40" /> <package id="DotNetZip.Reduced" version="1.9.1.8" targetFramework="net40" />
<package id="log4net" version="2.0.3" targetFramework="net40" />
<package id="SharpDX" version="2.6.2" targetFramework="net20" /> <package id="SharpDX" version="2.6.2" targetFramework="net20" />
<package id="SharpDX.DirectInput" version="2.6.2" targetFramework="net40" /> <package id="SharpDX.DirectInput" version="2.6.2" targetFramework="net40" />
</packages> </packages>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.
Loading…
Cancel
Save