Skip to content

SharpBlade/SharpBlade

Repository files navigation

SharpBlade

TC Status Huboard Status

A C# wrapper/implementation for the SwitchBlade UI API

Built using the SwitchBlade UI SDK from Razer.

Contributing

Contributors are very welcome! If you got code fixes, please submit a pull request here on GitHub.

If you want to join the development team, please contact Sharparam on GitHub.

All authors and contributors are listed in the AUTHORS file.

Please read the wiki page about contributing before submitting pull requests.

License

Copyright © 2013-2014 by Adam Hellberg and Brandon Scott.

This project is licensed under the MIT license, please see the file LICENSE for more information.

Images in res/images are created by Graham Hough.

Razer is a trademark and/or a registered trademark of Razer USA Ltd.
All other trademarks are property of their respective owners.

This project is in no way endorsed, sponsored or approved by Razer.

Apache log4net Copyright 2004-2011 The Apache Software Foundation (Apache License 2.0).

Dependencies

SharpBlade depends on the SwitchBlade UI SDK (RzSwitchbladeSDK2.dll).

SwitchBlade UI SDK is provided by Razer and can be obtained from their website.

SharpBlade depends on the log4net library (provided).

Building

It's important to note that this project doesn't build on the "AnyCPU" platform (which is the default for C# projects). It builds against x86 to stay compliant with Razer's code which targets the x86 platform. When building with MSBuild, you'd run something like:

msbuild SharpBlade.sln /p:Configuration=Release;Platform=x86

Make sure that your projects using SharpBlade are also compiled against x86.

SharpBlade does have a configuration mode that compiles it in AnyCPU, but it's untested, to run that config, simply replace Platform=x86 in the above command with Platform=AnyCPU.

Debugging / Logging

You may have to enable Native Code Debugging in the project settings to properly debug projects using SharpBlade.

SharpBlade outputs log information to the standard output stream by default, if it fails to detect any log4net config information in the default location (App.config).

If you want log4net to output to a file, you can put the following in your App.config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
  </configSections>
  <log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
      <file value="app.log" /> <!-- Change filename if desired -->
      <appendToFile value="false" />
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>
    <root>
      <level value="INFO" /> <!-- Change "INFO" to "DEBUG" to make logging more verbose -->
      <appender-ref ref="FileAppender" />
    </root>
  </log4net>
</configuration>

(Note that if you already have stuff in your App.config, just add the <log4net> section and add the <section /> tag to <configSections>)

This will cause log output to be saved in a file named "app.log" in the same directory as the executable.

Projects

Current projects utilizing this or modified versions of this library:

(If you want your project listed, just contact Sharparam or Brandon)