HamBook – Rev 54
?pathlinks?
using System;
using System.Reflection;
using System.Xml.Serialization;
namespace HamBook.Radios.Generic
{
[XmlRoot(Namespace = "Generic")]
[XmlInclude(typeof(Yaesu.FT_891.MemoryRadioMode))]
public abstract class MemoryRadioMode
{
[XmlIgnore] public abstract char Code { get; set; }
[XmlIgnore] public abstract string Name { get; set; }
public abstract string CodeToName(char code);
public abstract char NameToCode(string name);
public static MemoryRadioMode Create(string radio, params object[] param)
{
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
foreach (var type in assembly.GetTypes())
if (typeof(MemoryRadioMode).IsAssignableFrom(type))
{
var radioAttribute = type.GetCustomAttribute<RadioAttribute>();
if (radioAttribute != null && radioAttribute.Radio == radio)
return (MemoryRadioMode)Activator.CreateInstance(type, param);
}
return null;
}
}
}
Generated by GNU Enscript 1.6.5.90.