public static void ParseXMLProperties(ASTNode node, XElement xml, XMLProperties prop) { if (prop.parseLineContext) xml.Add(node.Context.ToXML()); if (prop.parseScope) xml.Add(node.Scope.ToXML()); }
public GeneralControl(XMLProperties properties) { InitializeComponent(); general = properties.general; updateCurrentPath(); }
public static XMLProperties GetXMLProperties() { try { if (!Directory.Exists(globalVariables.m_strPropertiesFolder)) { Directory.CreateDirectory(globalVariables.m_strPropertiesFolder); } var myProperty = new XMLProperties(); string filePath = string.Format(@"{0}\{1}.xml", globalVariables.m_strPropertiesFolder, myProperty.GetType().Name); if (!File.Exists(filePath)) { return(myProperty); } var myFileStream = new FileStream(filePath, FileMode.Open); var mySerializer = new XmlSerializer(myProperty.GetType()); myProperty = (XMLProperties)mySerializer.Deserialize(myFileStream); myFileStream.Close(); return(myProperty); } catch (Exception ex) { return(new XMLProperties()); } }
// Load all options from the config.xml file to use in the 'Properties' window. public static XMLProperties LoadOptions() { XMLProperties properties; try { properties = new XMLProperties(DefaultInfo.BuildsConfigLocation); } catch (Exception ex) when(ex is DirectoryNotFoundException || ex is XmlException || ex is FileNotFoundException) { CreateDefaultInformation(); properties = new XMLProperties(DefaultInfo.BuildsConfigLocation); } return(properties); }
private void populateOptions() { try { buildOptions = BasicInfo.LoadOptions(); } catch (XmlException ex) { Dialogs.ErrorMessage(ex.Message); return; } optionsToControl = new Dictionary <string, UserControl>() { { "General", new GeneralControl(buildOptions) } }; foreach (string option in buildOptions.options) { listViewOptions.Items.Add(option); } }