Exemplo n.º 1
0
        private void SelectThickness(BrushThicknessViewModel thicknessVM)
        {
            if (thicknessVM == null)
            {
                return;
            }
            IEnumerator <BrushThicknessViewModel> enumerator = this.ViewModel.ThicknessItems.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    BrushThicknessViewModel current = enumerator.Current;
                    current.IsSelected = current.Thickness == thicknessVM.Thickness;
                    if (current.IsSelected)
                    {
                        // ISSUE: reference to a compiler-generated field
                        EventHandler <int> thicknessSelected = this.ThicknessSelected;
                        if (thicknessSelected != null)
                        {
                            int thickness = current.Thickness;
                            thicknessSelected(this, thickness);
                        }
                    }
                }
            }
            finally
            {
                if (enumerator != null)
                {
                    enumerator.Dispose();
                }
            }
        }
Exemplo n.º 2
0
        public void SetThickness(int thickness)
        {
            if (this.ViewModel == null)
            {
                return;
            }
            IEnumerator <BrushThicknessViewModel> enumerator = this.ViewModel.ThicknessItems.GetEnumerator();

            try
            {
                while (enumerator.MoveNext())
                {
                    BrushThicknessViewModel current = enumerator.Current;
                    int num = current.Thickness == thickness ? 1 : 0;
                    current.IsSelected = num != 0;
                }
            }
            finally
            {
                if (enumerator != null)
                {
                    enumerator.Dispose();
                }
            }
        }
Exemplo n.º 3
0
 private void SelectThickness(BrushThicknessViewModel thicknessVM)
 {
     if (thicknessVM == null)
     {
         return;
     }
     foreach (BrushThicknessViewModel thicknessItem in this.ViewModel.ThicknessItems)
     {
         thicknessItem.IsSelected = thicknessItem.Thickness == thicknessVM.Thickness;
         if (thicknessItem.IsSelected)
         {
             EventHandler <int> eventHandler = this.ThicknessSelected;
             if (eventHandler != null)
             {
                 int thickness = thicknessItem.Thickness;
                 eventHandler((object)this, thickness);
             }
         }
     }
 }