diff --git a/rabi_splitter_WPF/ExportPanel.xaml b/rabi_splitter_WPF/ExportPanel.xaml
deleted file mode 100644
index ba5ce5b..0000000
--- a/rabi_splitter_WPF/ExportPanel.xaml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/rabi_splitter_WPF/ExportPanel.xaml.cs b/rabi_splitter_WPF/ExportPanel.xaml.cs
deleted file mode 100644
index 621a2e3..0000000
--- a/rabi_splitter_WPF/ExportPanel.xaml.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace rabi_splitter_WPF
-{
- ///
- /// Interaction logic for ExportPanel.xaml
- ///
- public partial class ExportPanel : UserControl
- {
- public object VariableExportObject
- {
- get { return (object)GetValue(VariableExportObjectProperty); }
- set { SetValue(VariableExportObjectProperty, value); }
-
- }
-
- public static readonly DependencyProperty VariableExportObjectProperty =
- DependencyProperty.Register("VariableExportObject", typeof(object),
- typeof(VariableExportSetting), new PropertyMetadata(null));
-
- public ExportPanel()
- {
- InitializeComponent();
- this.MainPanel.DataContext = this;
- }
- }
-}
diff --git a/rabi_splitter_WPF/MainContext.cs b/rabi_splitter_WPF/MainContext.cs
index 366471f..db25e70 100644
--- a/rabi_splitter_WPF/MainContext.cs
+++ b/rabi_splitter_WPF/MainContext.cs
@@ -128,7 +128,7 @@ namespace rabi_splitter_WPF
}
}
- class DebugContext : INotifyPropertyChanged
+ public class DebugContext : INotifyPropertyChanged
{
private int _entityAnalysisIndex;
private bool _bossEvent;
diff --git a/rabi_splitter_WPF/MainWindow.xaml b/rabi_splitter_WPF/MainWindow.xaml
index f1145bd..43f3076 100644
--- a/rabi_splitter_WPF/MainWindow.xaml
+++ b/rabi_splitter_WPF/MainWindow.xaml
@@ -10,107 +10,110 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
diff --git a/rabi_splitter_WPF/MainWindow.xaml.cs b/rabi_splitter_WPF/MainWindow.xaml.cs
index 19bf464..5b2f080 100644
--- a/rabi_splitter_WPF/MainWindow.xaml.cs
+++ b/rabi_splitter_WPF/MainWindow.xaml.cs
@@ -27,6 +27,7 @@ namespace rabi_splitter_WPF
private MainContext mainContext;
private RabiRibiDisplay rabiRibiDisplay;
private DebugContext debugContext;
+ private VariableExportContext variableExportContext;
private static TcpClient tcpclient;
private static NetworkStream networkStream;
private readonly Regex titleReg = new Regex(@"ver.*?(\d+\.?\d+.*)$");
@@ -110,11 +111,14 @@ namespace rabi_splitter_WPF
InitializeComponent();
mainContext=new MainContext();
debugContext=new DebugContext();
+ variableExportContext = new VariableExportContext();
this.DataContext = mainContext;
DebugPanel.DataContext = debugContext;
this.Grid.ItemsSource = debugContext.BossList;
EntityDataPanel.DataContext = debugContext;
this.EntityStats.ItemsSource = debugContext.EntityStatsListView;
+ this.VariableExportTab.DataContext = variableExportContext;
+ this.VariableExportTab.Initialise(debugContext, variableExportContext);
BossEventDebug.DataContext = debugContext;
rabiRibiDisplay = new RabiRibiDisplay(mainContext, debugContext, this);
memoryThread = new Thread(() =>
diff --git a/rabi_splitter_WPF/VariableExportContext.cs b/rabi_splitter_WPF/VariableExportContext.cs
new file mode 100644
index 0000000..ce1b7dd
--- /dev/null
+++ b/rabi_splitter_WPF/VariableExportContext.cs
@@ -0,0 +1,43 @@
+using rabi_splitter_WPF.Annotations;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Windows;
+
+namespace rabi_splitter_WPF
+{
+ public class VariableExportContext : INotifyPropertyChanged
+ {
+ private List _variableExportSettings;
+
+ public VariableExportContext()
+ {
+ //_variableExportSettings = new List();
+ _variableExportSettings =
+ new List
+ {
+ new VariableExportSetting() {OutputFileName = "Test.txt" }
+ };
+ }
+
+ public List VariableExportSettings
+ {
+ get { return _variableExportSettings; }
+ }
+
+ internal void Add(VariableExportSetting ves)
+ {
+ _variableExportSettings.Add(ves);
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ [NotifyPropertyChangedInvocator]
+ protected virtual void OnPropertyChanged(string propertyName)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+ }
+}
diff --git a/rabi_splitter_WPF/VariableExportSetting.cs b/rabi_splitter_WPF/VariableExportSetting.cs
index ecc614b..c35e1df 100644
--- a/rabi_splitter_WPF/VariableExportSetting.cs
+++ b/rabi_splitter_WPF/VariableExportSetting.cs
@@ -7,33 +7,72 @@ using System.Text;
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 GetAll()
+ {
+ return new List()
+ {
+ 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 GetAll()
+ public override int GetHashCode()
{
- return new List();
+ return _id.GetHashCode();
}
+ #endregion
}
- class VariableExportSetting : INotifyPropertyChanged
+ public class VariableExportSetting : INotifyPropertyChanged
{
private ExportableVariable _selectedVariable;
private string _outputFileName;
private string _outputFormat;
private bool _isExporting;
- #region Dictionaries
-
- // Captions for Split Trigger Options
- private static readonly Dictionary _variableCaptions = new Dictionary()
- {
- };
+ #region Dictionaries
+ private static Dictionary _variableCaptions;
public Dictionary VariableCaptions
{
- get {return _variableCaptions;}
+ get
+ {
+ if (_variableCaptions == null)
+ {
+ _variableCaptions = ExportableVariable.GetAll().ToDictionary(ev => ev, ev => ev.DisplayName);
+ }
+ return _variableCaptions;
+ }
}
#endregion
diff --git a/rabi_splitter_WPF/VariableExportTab.xaml b/rabi_splitter_WPF/VariableExportTab.xaml
new file mode 100644
index 0000000..30268d4
--- /dev/null
+++ b/rabi_splitter_WPF/VariableExportTab.xaml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/rabi_splitter_WPF/VariableExportTab.xaml.cs b/rabi_splitter_WPF/VariableExportTab.xaml.cs
new file mode 100644
index 0000000..3a8df15
--- /dev/null
+++ b/rabi_splitter_WPF/VariableExportTab.xaml.cs
@@ -0,0 +1,46 @@
+using rabi_splitter_WPF.Annotations;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace rabi_splitter_WPF
+{
+ ///
+ /// Interaction logic for VariableExportTab.xaml
+ ///
+ public partial class VariableExportTab : UserControl
+ {
+ private DebugContext debugContext;
+ private VariableExportContext variableExportContext;
+
+ public VariableExportTab()
+ {
+ InitializeComponent();
+ }
+
+ public void Initialise(DebugContext debugContext, VariableExportContext variableExportContext)
+ {
+ this.debugContext = debugContext;
+ this.variableExportContext = variableExportContext;
+ }
+
+ private void AddButton_Click(object sender, RoutedEventArgs e)
+ {
+ var ves = new VariableExportSetting();
+ ves.OutputFileName = "Hello.txt";
+ variableExportContext.Add(ves);
+ VariableExportListBox.Items.Refresh();
+ }
+ }
+}
diff --git a/rabi_splitter_WPF/rabi_display.csproj b/rabi_splitter_WPF/rabi_display.csproj
index cdc0d4a..c103380 100644
--- a/rabi_splitter_WPF/rabi_display.csproj
+++ b/rabi_splitter_WPF/rabi_display.csproj
@@ -38,6 +38,8 @@
+
+
@@ -64,10 +66,11 @@
-
- ExportPanel.xaml
-
+
+
+ VariableExportTab.xaml
+
MSBuild:Compile
Designer
@@ -81,7 +84,7 @@
MainWindow.xaml
Code
-
+
Designer
MSBuild:Compile