Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Initialize()

override void ReLogic.Peripherals.RGB.Razer.RazerDeviceGroup.Initialize ( )
inlineprotected

Definition at line 23 of file RazerDeviceGroup.cs.

24 {
26 {
27 return;
28 }
29 if (!NativeLibrary.TryLoad("RzChromaSDK64.dll", Assembly.GetEntryAssembly(), DllImportSearchPath.SafeDirectories, out var _))
30 {
32 return;
33 }
34 try
35 {
36 RzResult rzResult = NativeMethods.Init();
37 if (rzResult != 0)
38 {
39 int num = (int)rzResult;
40 throw new DeviceInitializationException("Unable to initialize Razer Synapse: " + num);
41 }
42 _isInitialized = true;
43 _devices.Add(new RazerMouse(_colorProfiles.Mouse));
44 _devices.Add(new RazerKeyboard(_colorProfiles.Keyboard));
45 _devices.Add(new RazerMousepad(_colorProfiles.Mousepad));
46 _devices.Add(new RazerKeypad(_colorProfiles.Keypad));
47 _devices.Add(new RazerHeadset(_colorProfiles.Headset));
48 _devices.Add(new RazerLink(_colorProfiles.Generic));
49 Console.WriteLine("Razer Chroma initialized.");
50 }
51 catch (DeviceInitializationException)
52 {
53 Console.WriteLine("Razer Chroma not supported. (Can be disabled via Config.json)");
55 }
56 catch (Exception ex2)
57 {
58 Console.WriteLine("Razer Chroma not supported: " + ex2);
60 }
61 }
void Add(TKey key, TValue value)
static void WriteLine()
Definition Console.cs:733
static ? Assembly GetEntryAssembly()
Definition Assembly.cs:486
static bool TryLoad(string libraryPath, out IntPtr handle)

References ReLogic.Peripherals.RGB.Razer.RazerDeviceGroup._colorProfiles, ReLogic.Peripherals.RGB.Razer.RazerDeviceGroup._devices, ReLogic.Peripherals.RGB.Razer.RazerDeviceGroup._initializationFailed, ReLogic.Peripherals.RGB.Razer.RazerDeviceGroup._isInitialized, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), ReLogic.Peripherals.RGB.VendorColorProfile.Generic, System.Reflection.Assembly.GetEntryAssembly(), ReLogic.Peripherals.RGB.VendorColorProfile.Headset, ReLogic.Peripherals.RGB.Razer.NativeMethods.Init(), ReLogic.Peripherals.RGB.VendorColorProfile.Keyboard, ReLogic.Peripherals.RGB.VendorColorProfile.Keypad, ReLogic.Peripherals.RGB.VendorColorProfile.Mouse, ReLogic.Peripherals.RGB.VendorColorProfile.Mousepad, System.Runtime.InteropServices.NativeLibrary.TryLoad(), ReLogic.Peripherals.RGB.Razer.RazerDeviceGroup.Uninitialize(), and System.Console.WriteLine().