Ejemplo n.º 1
0
        private void NewWatch_OnClick(object sender, RoutedEventArgs e)
        {
            _model = CreateWatchInfoNew();

            UpdateViewModel(_model);
            WatchInfoCombo.SelectedItem = null;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
     }
 }
Ejemplo n.º 5
0
        public CarpetManager(CarpetWatchInfo info)
        {
            Info = info;

            _shortcut = new Shortcut();
        }