public static SettingsList GetClasses() { SettingsList classes = new SettingsList(); Type[] types = typeof(DAERegister).Assembly.GetTypes(); foreach (Type type in types) { // Nodes if (type.IsSubclassOf(typeof(PlanNode))) { classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName)); } // Devices if (type.IsSubclassOf(typeof(Schema.Device))) { classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName)); } // Conveyors if (type.IsSubclassOf(typeof(Conveyor))) { classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName)); } // DeviceOperator if (type.IsSubclassOf(typeof(Schema.DeviceOperator))) { classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName)); } // DeviceScalarType if (type.IsSubclassOf(typeof(Schema.DeviceScalarType))) { classes.Add(new SettingsItem(String.Format("{0},{1}", type.FullName, AssemblyNameUtility.GetName(type.Assembly.FullName)), type.AssemblyQualifiedName)); } } return(classes); }
/// <summary> Determines the element namespace to use when writing the specified type. </summary> protected virtual string GetElementNamespace(Type type) { return(String.Format("{0},{1}", type.Namespace, AssemblyNameUtility.GetName(type.Assembly.FullName))); }