Exemplo n.º 1
0
        private void OnCheckStyle(bool isChecked)
        {
            var replacementSelected = ReplacementTextStyles.Count(x => x.IsSelected) > 0;

            foreach (var d in ReplacementTextStyles)
            {
                if (replacementSelected)
                {
                    d.IsEnabled = d.IsSelected;
                    continue;
                }

                d.IsEnabled = !TextStyles.Where(x => x.IsSelected).Contains(d);
            }

            // if none of the types are selected let's clean selection
            // in replacement table as well
            if (TextStyles.Any(x => x.IsSelected))
            {
                return;
            }
            foreach (var d in ReplacementTextStyles)
            {
                d.IsSelected = false;
            }
        }
Exemplo n.º 2
0
 private void OnCheckReplacementStyle(bool isChecked)
 {
     foreach (var d in ReplacementTextStyles)
     {
         if (isChecked)
         {
             d.IsEnabled = d.IsSelected;
         }
         else
         {
             d.IsEnabled = !TextStyles.Where(x => x.IsSelected).Contains(d);
         }
     }
 }
Exemplo n.º 3
0
        private void OnReplace()
        {
            var styles      = TextStyles.Where(x => x.IsSelected).ToList();
            var replacement = ReplacementTextStyles.FirstOrDefault(x => x.IsSelected);

            if (!styles.Any() || replacement == null)
            {
                StatusBarManager.StatusLabel.Text = "Please select at least one (1) Dimension Type and Replacement Dimension Type.";
                return;
            }

            AppCommand.StylesManagerHandler.Arg1 = styles;
            AppCommand.StylesManagerHandler.Arg2 = replacement;
            AppCommand.StylesManagerHandler.Request.Make(StylesRequestType.ReplaceTextStyles);
            AppCommand.StylesManagerEvent.Raise();
        }