|
|
@ -7,17 +7,53 @@ using System.Text; |
|
|
|
|
|
|
|
|
|
|
|
namespace rabi_splitter_WPF |
|
|
|
namespace rabi_splitter_WPF |
|
|
|
{ |
|
|
|
{ |
|
|
|
class ExportableVariable |
|
|
|
public class ExportableVariable |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
// Do not make these properties public. |
|
|
|
|
|
|
|
private static int nextAvailableId = 0; |
|
|
|
|
|
|
|
private readonly int _id; |
|
|
|
|
|
|
|
private readonly string _displayName; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ExportableVariable(string displayName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_id = nextAvailableId++; |
|
|
|
|
|
|
|
_displayName = displayName; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int Id |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
get { return _id; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public string DisplayName |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
get { return _displayName; } |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<ExportableVariable> GetAll() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return new List<ExportableVariable>() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
new ExportableVariable("TestVariable") |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Equals, GetHashCode |
|
|
|
|
|
|
|
public override bool Equals(object obj) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var otherValue = obj as ExportableVariable; |
|
|
|
|
|
|
|
if (otherValue == null) return false; |
|
|
|
|
|
|
|
return _id.Equals(otherValue.Id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<ExportableVariable> GetAll() |
|
|
|
public override int GetHashCode() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return new List<ExportableVariable>(); |
|
|
|
return _id.GetHashCode(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#endregion |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
class VariableExportSetting : INotifyPropertyChanged |
|
|
|
public class VariableExportSetting : INotifyPropertyChanged |
|
|
|
{ |
|
|
|
{ |
|
|
|
private ExportableVariable _selectedVariable; |
|
|
|
private ExportableVariable _selectedVariable; |
|
|
|
private string _outputFileName; |
|
|
|
private string _outputFileName; |
|
|
@ -25,15 +61,18 @@ namespace rabi_splitter_WPF |
|
|
|
private bool _isExporting; |
|
|
|
private bool _isExporting; |
|
|
|
|
|
|
|
|
|
|
|
#region Dictionaries |
|
|
|
#region Dictionaries |
|
|
|
|
|
|
|
private static Dictionary<ExportableVariable, string> _variableCaptions; |
|
|
|
// Captions for Split Trigger Options |
|
|
|
|
|
|
|
private static readonly Dictionary<ExportableVariable, string> _variableCaptions = new Dictionary<ExportableVariable, string>() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Dictionary<ExportableVariable, string> VariableCaptions |
|
|
|
public Dictionary<ExportableVariable, string> VariableCaptions |
|
|
|
{ |
|
|
|
{ |
|
|
|
get {return _variableCaptions;} |
|
|
|
get |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (_variableCaptions == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_variableCaptions = ExportableVariable.GetAll().ToDictionary(ev => ev, ev => ev.DisplayName); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return _variableCaptions; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion |
|
|
|
#endregion |
|
|
|