diff options
Diffstat (limited to 'Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs | 129 |
1 files changed, 92 insertions, 37 deletions
diff --git a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs index bf2db0084..6c24121ba 100644 --- a/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs +++ b/Software/Visual_Studio/Utilities/Tango.UITests/MainWindow.xaml.cs @@ -20,6 +20,7 @@ using System.Windows.Shapes; using System.Windows.Threading; using Tango.BL; using Tango.BL.Builders; +using Tango.BL.Catalogs; using Tango.BL.Entities; using Tango.Core; using Tango.Core.Commands; @@ -38,8 +39,6 @@ using TableDependency.SqlClient.Base.EventArgs; using TableDependency.SqlClient.Base.Abstracts; using Tango.Core.Components; using System.Text.RegularExpressions; -using Tango.SharedUI.Controls; -using System.ComponentModel; namespace Tango.UITests { @@ -48,50 +47,106 @@ namespace Tango.UITests /// </summary> public partial class MainWindow : Window { - private ObservableCollection<object> _selectedItems; + //private ITableDependency _dep; - public ObservableCollection<object> SelectedItems + //private DataSource _dataSource; + + public MainWindow() { - get { return _selectedItems; } - set { _selectedItems = value; } - } + //_dataSource = new DataSource() + //{ + // Address = "twine.database.windows.net", + // Catalog = "Tango_DEV", + // Type = DataSourceType.SQLServer, + // UserName = "Roy", + // Password = "Aa123456", + // IntegratedSecurity = false, + //}; - private ObservableCollection<string> _items; - + //InitializeComponent(); + //EntityFrameworkCache.Initialize(new MyMemoryCache() { Expiration = TimeSpan.FromMinutes(1) }); - public ObservableCollection<string> Items - { - get { return _items; } - set { _items = value; } - } - public MainWindow() - { - SelectedItems = new ObservableCollection<object> - { - //new MultiSelectComboBoxItem("item1"), - //new MultiSelectComboBoxItem("item2"), - //new MultiSelectComboBoxItem("item3"), - //new MultiSelectComboBoxItem("item4"), - //new MultiSelectComboBoxItem("item5") + //this.Closing += MainWindow_Closing; + + //CmdCommand command = new CmdCommand("wmic", "pagefile list /format:list"); + //var result = command.Run().Result; + + //Regex regEx = new Regex("Name=(.+)"); + //var pageFiles = regEx.Matches(result.StandardOutput).OfType<Match>().Select(x => x.Groups.OfType<Group>().LastOrDefault()).ToList().Select(x => x.Value.Replace("\n", "").Replace("\r", "")).ToList(); - }; - Items = new ObservableCollection<string> - { - "item1", - "item2", - "item3", - "item4", - "item5", - "item6", - "item7", - "item8", - "item9", + + //var matches = matches.OfType<Match>().Select(x => x.Groups.OfType<Group>().Last().Value.Replace("\n","").Replace("\r","")).ToList(); - }; - InitializeComponent(); } + + //private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) + //{ + // //if (_dep != null) + // //{ + // // _dep.Stop(); + // // _dep.Dispose(); + // //} + //} + + + //private void btnStart_Click(object sender, RoutedEventArgs e) + //{ + // Stopwatch watch = Stopwatch.StartNew(); + + // using (ObservablesContext db = ObservablesContext.CreateDefault(_dataSource)) + // { + // var users = db.Users.ToList(); + // var jobs = new JobsCollectionBuilder(db).SetAll().WithSegments().WithBrushStops().Build(); + // var first_job = jobs.First(); + + // if (first_job.Name == "Changed Name 2") + // { + // Debug.WriteLine("Changed and cached !!!"); + // } + // else + // { + // Debug.WriteLine("Not working."); + // } + // } + + // Debug.WriteLine($"Time to complete: {watch.Elapsed.TotalSeconds} seconds"); + //} + + //private void btnChange_Click(object sender, RoutedEventArgs e) + //{ + // using (ObservablesContext db = ObservablesContext.CreateDefault(_dataSource)) + // { + // var jobs = new JobsCollectionBuilder(db).SetAll().WithSegments().WithBrushStops().Build(); + // var first_job = jobs.First(); + // first_job.Name = "Changed Name 2"; + // db.SaveChanges(); + // } + //} + + //private void btnListen_Click(object sender, RoutedEventArgs e) + //{ + // String str = _dataSource.ToConnection().ConnectionString; + + // var dep = new SqlTableDependency<DAL.Remote.DB.USER>(str, "USERS", "dbo"); + // dep.TraceLevel = TraceLevel.Verbose; + // dep.TraceListener = new TextWriterTraceListener(Console.Out); + + // dep.OnChanged += Changed; + // dep.Start(); + + // _dep = dep; + //} + + //private void Changed(object sender, RecordChangedEventArgs<DAL.Remote.DB.USER> e) + //{ + // var changedEntity = e.Entity; + + // Console.WriteLine("DML operation: " + e.ChangeType); + + // Console.WriteLine(changedEntity.ToJsonString()); + //} } } |
