You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SCJMapper-V2/DeviceCls.cs

57 lines
1.9 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SCJMapper_V2
{
/// <summary>
/// Basic device as DXInput device
/// </summary>
public abstract class DeviceCls
{
public const String DeviceClass ="UNDEF";
public const String DeviceID = "NA0_";
static public Boolean IsUndefined( String deviceClass )
{
return ( deviceClass == DeviceClass );
}
public const String BlendedInput = "~"; // internal used only
static public Boolean IsBlendedInput( String input ) { return ( input == BlendedInput ); }
static public Boolean IsDeviceClass( String deviceClass ) { return false; }
static public String DeviceClassFromInput( String input ) { return DeviceClass; }
static public String DevInput( String input ) { return input; }
static public Boolean DevMatch( String devInput ) { return false; }
public abstract String DevClass { get; }
public abstract String DevName { get; }
public abstract System.Drawing.Color MapColor { get; }
public abstract Boolean Activated { get; set; }
public virtual void FinishDX( ) { }
public virtual void ApplySettings( ) { }
public abstract String GetLastChange( );
public abstract void GetCmdData( String cmd, out int data );
public abstract void GetData( );
static public String toXML( String blendedInput )
{
return blendedInput.Replace( BlendedInput, " " ); // must make spaces (tilde is for internal processing only)
}
static public String toXMLBlendExtension( String blendedInput )
{
return (IsBlendedInput(blendedInput) ? string.Format( "multiTap=\"1\"") : "" ); // blending needs to overwrite potential multitaps (2+)
}
static public String fromXML( String blendedInput )
{
return blendedInput.Replace( " ", BlendedInput ); // must make tilde (spaces is for external processing only)
}
}
}