make open subtitle project portable

This commit is contained in:
Luke Pulverenti
2016-10-27 18:54:56 -04:00
parent 0d5e95222a
commit 31c8c3bf7f
16 changed files with 9229 additions and 86 deletions

View File

@@ -37,17 +37,17 @@ namespace OpenSubtitlesHandler
protected double seconds;
protected string status;
protected virtual void LoadAttributes()
protected void LoadAttributes()
{
foreach (Attribute attr in Attribute.GetCustomAttributes(this.GetType()))
{
if (attr.GetType() == typeof(MethodResponseDescription))
{
this.name = ((MethodResponseDescription)attr).Name;
this.message = ((MethodResponseDescription)attr).Message;
break;
}
}
//foreach (Attribute attr in Attribute.GetCustomAttributes(this.GetType()))
//{
// if (attr.GetType() == typeof(MethodResponseDescription))
// {
// this.name = ((MethodResponseDescription)attr).Name;
// this.message = ((MethodResponseDescription)attr).Message;
// break;
// }
//}
}
[Description("The name of this response"), Category("MethodResponse")]
@@ -59,4 +59,14 @@ namespace OpenSubtitlesHandler
[Description("The status"), Category("MethodResponse")]
public string Status { get { return status; } set { status = value; } }
}
public class DescriptionAttribute : Attribute
{
public DescriptionAttribute(string text) { }
}
public class CategoryAttribute : Attribute
{
public CategoryAttribute(string text) { }
}
}