Example #1
0
 public PressScheduleWindow()
 {
     InitializeComponent();
     PressManager.Window = this;
     PressManager.Load();
     foreach (var plateConfiguration in PressManager.PlateConfigurations)
     {
         WeekControls.Add(new PressPlateConfigurationControl(plateConfiguration));
     }
     DataContext = this;
 }
Example #2
0
        //  private void Save(string fileName)
        //  {
        //      try
        //      {
        //          using (BinaryWriter writer = new BinaryWriter(new FileStream(fileName, FileMode.OpenOrCreate)))
        //          {
        //              writer.Write(WeekControls.Count);
        //              foreach (var pressWeekControl in WeekControls)
        //              {
        ////                  pressWeekControl.Save(writer);
        //              }
        //          }
        //      }
        //      catch (Exception)
        //      {
        //          MessageBox.Show("Save failed.");
        //      }
        //  }

        private void LoadMenuItem_OnClick(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog()
            {
                Multiselect = false
            };
            var result = openFileDialog.ShowDialog();

            if (result == true)
            {
                PressManager.Load();
                WeekControls.Clear();
                foreach (var plateConfiguration in PressManager.PlateConfigurations)
                {
                    WeekControls.Add(new PressPlateConfigurationControl(plateConfiguration));
                }
            }
        }