private static string WritePresetLine(ConfigItem item)
 {
     return string.Format("{0},{1}", item.Parameter, item.Value);
 }
        private static ConfigItem ParsePresetLine(string line)
        {
            var item = new ConfigItem();

            var pieces = line.Split(',');

            if (pieces.Any())
            {
                item.Parameter = pieces[0];
                if (pieces.Count() >= 2)
                    item.Value = pieces[1];
            }
            return item;
        }
        private static ConfigItem ParseBaseLine(string line)
        {
            var item = new ConfigItem();

            var pieces = line.Split(';');

            if (pieces.Any())
            {
                item.Name = pieces[0];
                if (pieces.Count() >= 2)
                    item.Parameter = pieces[1];
                if (pieces.Count() >= 3)
                    item.CanHaveValue = bool.Parse(pieces[2]);
                if (pieces.Count() >= 4)
                    item.Description = pieces[3];
                if (pieces.Count() >= 5)
                    item.Warning = pieces[4];
            }
            return item;
        }
Beispiel #4
0
 private static string WritePresetLine(ConfigItem item)
 {
     return(string.Format("{0},{1}", item.Parameter, item.Value));
 }
        private void ConfigDataGrid_MouseUp(object sender, MouseButtonEventArgs e)
        {
            ChosenItem = (ConfigItem) ConfigDataGrid.SelectedItem;

            Close();
        }
        private void ConfigDataGrid_MouseUp(object sender, MouseButtonEventArgs e)
        {
            ChosenItem = (ConfigItem)PresetMapDataGrid.SelectedItem;

            Close();
        }