private static Type[] GetExtraTypes() { var sectionTypes = SectionType.GetTypeArray(); var widgetTypes = ControlType.GetTypeArray(); var combinedTypes = sectionTypes.Concat(widgetTypes).ToArray(); return(combinedTypes); }
public static void Save(SectionType item) { string ConfigPath = ConfigurationLoader.GetFileConfigurationPath(); string filePath = String.Format("{0}SectionTypes\\{1}.xml", ConfigPath, item.Name); ConfigurationLoader.SerializeObjectToFile(item, filePath); }
public static Section GetNewSection(string type) { SectionType sectionType = SectionType.GetByName(type); string assemblyQualifiedName = String.Format("{0}, {1}", sectionType.AbstractionClass, sectionType.AbstractionAssembly); Type t = System.Type.GetType(assemblyQualifiedName, false, true); Section retval = (Section)Activator.CreateInstance(t); return(retval); }
public static SectionType GetByName(string Name) { SectionType item = Configuration.GetInstance().SectionTypes .Where(i => ( (i.Name.ToLower() == Name.ToLower()) ) ) .SingleOrDefault(); return(item); }
public static SectionType GetSectionType(Section item) { SectionType sectionType = Configuration.GetInstance().SectionTypes .Where(s => ( (s.Name.ToLower() == item.Type.ToLower()) ) ) .SingleOrDefault(); return(sectionType); }
public static void Load(XDocument doc) { XmlSerializer serializer = new XmlSerializer(typeof(SectionType)); XmlReader reader = doc.CreateReader(); reader.MoveToContent(); SectionType item = null; try { item = (SectionType)serializer.Deserialize(reader); } catch (Exception ex) { throw new ApplicationException(String.Format("Error occurred while processing SectionType", doc.Root.FirstNode.ToString()), ex); } Configuration.GetInstance().SectionTypes.Add(item); }