예제 #1
0
        private void NewWatch_OnClick(object sender, RoutedEventArgs e)
        {
            _model = CreateWatchInfoNew();

            UpdateViewModel(_model);
            WatchInfoCombo.SelectedItem = null;
        }
예제 #2
0
        public void UpdateViewModel(CarpetWatchInfo info)
        {
            //TODO: add automapper
            _viewModel = new CarpetWatchInfoEditViewModel
            {
                Name                  = info.Name,
                DestBaseDir           = info.DestBaseDir,
                IncludeSubdirectories = info.IncludeSubdirectories,
            };
            this.DataContext = _viewModel;

            CodeEditor.GenerateCode(info.Dirs, info.FileDestFunc, info.DirDestFunc);
        }
예제 #3
0
 private void WatchInfoCombo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (WatchInfoCombo.SelectedItem == null)
     {
         Delete.Visibility = Visibility.Collapsed;
         return;
     }
     else
     {
         Delete.Visibility = Visibility.Visible;
     }
     _model = (((ComboBoxItem)WatchInfoCombo.SelectedItem).DataContext as CarpetWatchInfo) ?? CreateWatchInfoNew();
     UpdateViewModel(_model);
 }
예제 #4
0
 private void InitViewModel(ComboBoxItem item)
 {
     if (item == null)
     {
         _model = CreateWatchInfoNew();
         UpdateViewModel(_model);
         WatchInfoCombo.SelectedItem = null;
     }
     else
     {
         _model = item.DataContext as CarpetWatchInfo;
         UpdateViewModel(_model);
         WatchInfoCombo.SelectedItem = item;
     }
 }
예제 #5
0
        public CarpetManager(CarpetWatchInfo info)
        {
            Info = info;

            _shortcut = new Shortcut();
        }