mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Improved resource manager, plugin manager
This commit is contained in:
11
RainmeterStudio.Rainmeter/DataTypes/Action.cs
Normal file
11
RainmeterStudio.Rainmeter/DataTypes/Action.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace RainmeterStudio.Rainmeter.DataTypes
|
||||
{
|
||||
public class Action
|
||||
{
|
||||
}
|
||||
}
|
63
RainmeterStudio.Rainmeter/DataTypes/Bang.cs
Normal file
63
RainmeterStudio.Rainmeter/DataTypes/Bang.cs
Normal file
@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace RainmeterStudio.Rainmeter.DataTypes
|
||||
{
|
||||
public abstract class Bang
|
||||
{
|
||||
/// <summary>
|
||||
/// Argument info
|
||||
/// </summary>
|
||||
public class ArgumentInfo
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Type DataType { get; set; }
|
||||
|
||||
public ArgumentInfo(string name, Type dataType)
|
||||
{
|
||||
Name = name;
|
||||
DataType = dataType;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the function name of the bang
|
||||
/// </summary>
|
||||
public abstract string FunctionName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the list of arguments
|
||||
/// </summary>
|
||||
public abstract IEnumerable<ArgumentInfo> Arguments { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Executes the bang
|
||||
/// </summary>
|
||||
public void Execute(params object[] args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the string representation of this bang
|
||||
/// </summary>
|
||||
/// <returns>String representation</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.AppendFormat("!{0}", FunctionName);
|
||||
|
||||
foreach (var arg in Arguments.Select(x => x.ToString()))
|
||||
{
|
||||
if (arg.Any(Char.IsWhiteSpace))
|
||||
builder.AppendFormat(@" ""{0}""", arg);
|
||||
|
||||
else builder.AppendFormat(" {0}", arg);
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user