private void BtnFromCustomBase_Click(object sender, RoutedEventArgs e) { int b; // основа на бройната с-ма try { b = int.Parse(BoxBase.Text); } catch (FormatException) { _ = MessageBox.Show("Некоректно въведена основа", "Грешка!", MessageBoxButton.OK, MessageBoxImage.Error); BoxBase.SelectAll(); BoxBase.Focus(); return; } try { BoxDec.Text = ToDec(BoxCustom.Text, int.Parse(BoxBase.Text)).ToString(); BoxBin.Text = FromDec(int.Parse(BoxDec.Text), 2); BoxHex.Text = FromDec(int.Parse(BoxDec.Text), 16); } catch (FormatException) { _ = MessageBox.Show("Некоректен формат на данните", "Грешка", MessageBoxButton.OK, MessageBoxImage.Error); BoxCustom.SelectAll(); BoxCustom.Focus(); } }
public Calendar(Project project, Display display, int width, int height) { this.project = project; boxCalendar = (BoxBase)BoxType.CreateInstance(); boxCalendar.Tag = int.MinValue; boxCalendar.Width = width; boxCalendar.Height = height; display.InsertShape(boxCalendar); Init(); }
public Calendar(Project project, ShapeBase parent, int width, int height) { this.project = project; boxCalendar = (BoxBase)BoxType.CreateInstance(); boxCalendar.Tag = int.MinValue; boxCalendar.Width = width; boxCalendar.Height = height; parent.Children.Add(boxCalendar); Init(); }