Exemplo n.º 1
0
        public void CreateMainWindow(User user)
        {
            MainWindowView mainWindowView = new MainWindowView();

            mainWindowView.CurrentUser = user;
            mainWindowView.Show();
            this.Close();
        }
Exemplo n.º 2
0
        public void OneTimeLoadRecords(MainWindowView mw)
        {
            CallerMainWindow = mw;
            string usersPath       = Path.Combine(User.Username, "records.ser");
            Stream stream          = File.Open(usersPath, FileMode.Open);
            var    binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();

            CallerMainWindow.Dict = (Dictionary <string, double>)binaryFormatter.Deserialize(stream);
        }
Exemplo n.º 3
0
 public void LoadRecords(MainWindowView mw)
 {
     if (mw != null)
     {
         CallerMainWindow = mw;
         ListBox box = mw.Start_Listbox;
         Dictionary <string, double> localDic = mw.Dict;
         foreach (var e in localDic)
         {
             StackPanel stack = new StackPanel();
             stack.Orientation = Orientation.Horizontal;
             stack.Children.Add(new Label
             {
                 Content = e.Key + ": "
             });
             stack.Children.Add(new Label
             {
                 Content = DoubleToTime(e.Value)
             });
             box.Items.Add(stack);
         }
     }
 }