mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Updated C# stuff.
This commit is contained in:
parent
34347117db
commit
055d64b605
@ -56,13 +56,6 @@ namespace Rainmeter
|
|||||||
[DllImport("Rainmeter.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
|
[DllImport("Rainmeter.dll", CharSet = CharSet.Auto, CallingConvention = CallingConvention.Cdecl)]
|
||||||
private extern static unsafe int LSLog(int type, char* unused, char* message);
|
private extern static unsafe int LSLog(int type, char* unused, char* message);
|
||||||
|
|
||||||
private enum RmGetType
|
|
||||||
{
|
|
||||||
MeasureName = 0,
|
|
||||||
Skin = 1,
|
|
||||||
SettingsFile = 2
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum LogType
|
public enum LogType
|
||||||
{
|
{
|
||||||
Error = 1,
|
Error = 1,
|
||||||
@ -92,18 +85,25 @@ namespace Rainmeter
|
|||||||
public unsafe int ReadInt(string option, int defValue)
|
public unsafe int ReadInt(string option, int defValue)
|
||||||
{
|
{
|
||||||
string value = ReadString(option, "");
|
string value = ReadString(option, "");
|
||||||
return Convert.ToInt32(value);
|
try
|
||||||
|
{
|
||||||
|
return Convert.ToInt32(value);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe string GetMeasureName()
|
public unsafe string GetMeasureName()
|
||||||
{
|
{
|
||||||
char* value = (char*)RmGet((void*)m_Rm, (int)RmGetType.MeasureName);
|
char* value = (char*)RmGet((void*)m_Rm, 0);
|
||||||
return new string(value);
|
return new string(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe IntPtr GetSkin()
|
public unsafe IntPtr GetSkin()
|
||||||
{
|
{
|
||||||
return (IntPtr)RmGet((void*)m_Rm, (int)RmGetType.Skin);
|
return (IntPtr)RmGet((void*)m_Rm, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static unsafe void Execute(IntPtr skin, string command)
|
public static unsafe void Execute(IntPtr skin, string command)
|
||||||
|
@ -53,7 +53,7 @@ namespace ExampleCS
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the measure settings must be (re)read.
|
/// Called when the measure settings must be (re)read.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal void Reload(Rainmeter.API rm)
|
internal void Reload(Rainmeter.API rm, ref double maxValue)
|
||||||
{
|
{
|
||||||
// Examples:
|
// Examples:
|
||||||
// string value = rm.ReadString("TestOption", "DefaultValue");
|
// string value = rm.ReadString("TestOption", "DefaultValue");
|
||||||
@ -118,7 +118,7 @@ namespace ExampleCS
|
|||||||
public unsafe static void Reload(void* data, void* rm, double* maxValue)
|
public unsafe static void Reload(void* data, void* rm, double* maxValue)
|
||||||
{
|
{
|
||||||
IntPtr dataPtr = (IntPtr)data;
|
IntPtr dataPtr = (IntPtr)data;
|
||||||
Measures[dataPtr].Reload(new Rainmeter.API((IntPtr)rm));
|
Measures[dataPtr].Reload(new Rainmeter.API((IntPtr)rm), ref *maxValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ExportUpdate
|
#if ExportUpdate
|
||||||
|
Loading…
Reference in New Issue
Block a user