public void AddItem()
        {
            var style = new NamingStyle();
            var viewModel = new NamingStyleViewModel(style, canBeDeleted: true, notificationService: _notificationService);
            var dialog = new NamingStyleDialog(viewModel);

            if (dialog.ShowDialog().Value == true)
            {
                Items.Add(viewModel);
            }
        }
Beispiel #2
0
        public void AddItem()
        {
            var style     = new MutableNamingStyle();
            var viewModel = new NamingStyleViewModel(style, canBeDeleted: true, notificationService: _notificationService);
            var dialog    = new NamingStyleDialog(viewModel);

            if (dialog.ShowModal().Value == true)
            {
                Items.Add(viewModel);
            }
        }
 private void CreateNamingStyle(object sender, RoutedEventArgs e)
 {
     var newNamingStyleViewModel = new NamingStyleViewModel(new NamingStyle(), _notificationService);
     var dialog = new NamingStyleDialog(newNamingStyleViewModel);
     var result = dialog.ShowModal();
     if (result == true)
     {
         _namingStylesViewModel.AddNamingStyle(newNamingStyleViewModel);
         _viewModel.NamingStyleIndex = _viewModel.NamingStyleList.IndexOf(newNamingStyleViewModel);
     }
 }
        private void CreateNamingStyle(object sender, RoutedEventArgs e)
        {
            var newNamingStyleViewModel = new NamingStyleViewModel(new NamingStyle(), _notificationService);
            var dialog = new NamingStyleDialog(newNamingStyleViewModel);
            var result = dialog.ShowModal();

            if (result == true)
            {
                _namingStylesViewModel.AddNamingStyle(newNamingStyleViewModel);
                _viewModel.NamingStyleIndex = _viewModel.NamingStyleList.IndexOf(newNamingStyleViewModel);
            }
        }
Beispiel #5
0
        public void EditItem(INamingStylesInfoDialogViewModel item)
        {
            var context = (NamingStyleViewModel)item;

            var style     = context.GetNamingStyle();
            var viewModel = new NamingStyleViewModel(style, context.CanBeDeleted, notificationService: _notificationService);
            var dialog    = new NamingStyleDialog(viewModel);

            if (dialog.ShowModal().Value == true)
            {
                context.ItemName                  = viewModel.ItemName;
                context.RequiredPrefix            = viewModel.RequiredPrefix;
                context.RequiredSuffix            = viewModel.RequiredSuffix;
                context.WordSeparator             = viewModel.WordSeparator;
                context.CapitalizationSchemeIndex = viewModel.CapitalizationSchemeIndex;
            }
        }
        public void EditItem(INamingStylesInfoDialogViewModel item)
        {
            var context = (NamingStyleViewModel)item;

            var style = context.GetNamingStyle();
            var viewModel = new NamingStyleViewModel(style, context.CanBeDeleted, notificationService: _notificationService);
            var dialog = new NamingStyleDialog(viewModel);

            if (dialog.ShowDialog().Value == true)
            {
                context.ItemName = viewModel.ItemName;
                context.RequiredPrefix = viewModel.RequiredPrefix;
                context.RequiredSuffix = viewModel.RequiredSuffix;
                context.WordSeparator = viewModel.WordSeparator;
                context.CapitalizationSchemeIndex = viewModel.CapitalizationSchemeIndex;
            }
        }
        private void NamingConventionList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var item = ((FrameworkElement)e.OriginalSource).DataContext as NamingStyleViewModel;

            if (item != null)
            {
                var style      = item.GetNamingStyle();
                var styleClone = style.Clone();

                var itemClone = new NamingStyleViewModel(styleClone, item._notificationService);

                var dialog = new NamingStyleDialog(itemClone);
                var result = dialog.ShowModal();
                if (result == true)
                {
                    item.NamingConventionName         = itemClone.NamingConventionName;
                    item.RequiredPrefix               = itemClone.RequiredPrefix;
                    item.RequiredSuffix               = itemClone.RequiredSuffix;
                    item.WordSeparator                = itemClone.WordSeparator;
                    item.FirstWordGroupCapitalization = itemClone.FirstWordGroupCapitalization;
                }
            }
        }
        private void ConfigureNamingStyles(object sender, RoutedEventArgs e)
        {
            if (_viewModel.NamingStyleIndex >= 0)
            {
                var namingStyleMutable = _viewModel.NamingStyleList.GetItemAt(_viewModel.NamingStyleIndex) as NamingStyleViewModel;

                var style      = namingStyleMutable.GetNamingStyle();
                var styleClone = style.Clone();

                var namingStyleClone = new NamingStyleViewModel(styleClone, _notificationService);

                var dialog = new NamingStyleDialog(namingStyleClone);
                var result = dialog.ShowModal();
                if (result == true)
                {
                    namingStyleMutable.NamingConventionName         = namingStyleClone.NamingConventionName;
                    namingStyleMutable.RequiredPrefix               = namingStyleClone.RequiredPrefix;
                    namingStyleMutable.RequiredSuffix               = namingStyleClone.RequiredSuffix;
                    namingStyleMutable.WordSeparator                = namingStyleClone.WordSeparator;
                    namingStyleMutable.FirstWordGroupCapitalization = namingStyleClone.FirstWordGroupCapitalization;
                }
            }
        }
        private void ConfigureNamingStyles(object sender, RoutedEventArgs e)
        {
            if (_viewModel.NamingStyleIndex >= 0)
            {
                var namingStyleMutable = _viewModel.NamingStyleList.GetItemAt(_viewModel.NamingStyleIndex) as NamingStyleViewModel;

                var style = namingStyleMutable.GetNamingStyle();
                var styleClone = style.Clone(); 

                var namingStyleClone = new NamingStyleViewModel(styleClone, _notificationService);

                var dialog = new NamingStyleDialog(namingStyleClone);
                var result = dialog.ShowModal();
                if (result == true)
                {
                    namingStyleMutable.NamingConventionName = namingStyleClone.NamingConventionName;
                    namingStyleMutable.RequiredPrefix = namingStyleClone.RequiredPrefix;
                    namingStyleMutable.RequiredSuffix = namingStyleClone.RequiredSuffix;
                    namingStyleMutable.WordSeparator = namingStyleClone.WordSeparator;
                    namingStyleMutable.FirstWordGroupCapitalization = namingStyleClone.FirstWordGroupCapitalization;
                }
            }
        }
        private void NamingConventionList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var item = ((FrameworkElement)e.OriginalSource).DataContext as NamingStyleViewModel;
            if (item != null)
            {
                var style = item.GetNamingStyle();
                var styleClone = style.Clone();

                var itemClone = new NamingStyleViewModel(styleClone, item._notificationService);

                var dialog = new NamingStyleDialog(itemClone);
                var result = dialog.ShowModal();
                if (result == true)
                {
                    item.NamingConventionName = itemClone.NamingConventionName;
                    item.RequiredPrefix = itemClone.RequiredPrefix;
                    item.RequiredSuffix = itemClone.RequiredSuffix;
                    item.WordSeparator = itemClone.WordSeparator;
                    item.FirstWordGroupCapitalization = itemClone.FirstWordGroupCapitalization;
                }
            }
        }