public void PhoneNumberAdd(int x, int y) { PhoneNumber tcn = PhoneNumberGet(x, y); if (tcn == null) { tcn = new PhoneNumber(x, y, GeneralSettings); if (DemoType == 1 && (x + y) % 2 == 0) { tcn.SetExtension(x + y); if ((x + y) % 3 == 0) { tcn.SetIsRange(true); } } else if (DemoType == 2) { tcn.SetExtension(x + y); } tcn.OnFontSettingChanged(GeneralSettings); AddPhoneNumber(tcn); Grid.SetColumn(tcn, x); Grid.SetRow(tcn, y); } DrawArea.AddPhoneNumber(tcn); }
private void Button_Click_Ok(object sender, RoutedEventArgs e) { if (App.Current != null && App.Current.MainWindow != null) { PhoneNumber EditedPhoneNumber = (App.Current.MainWindow as MainWindow).PhoneNumberGet(ParentX, ParentY); EditedPhoneNumber.SetIsRange(true); try { int Extension = Int32.Parse(this.SubscriberExtension.Text); EditedPhoneNumber.SetExtension(Extension); } catch (Exception) { }; EditedPhoneNumber.OnFontSettingChanged(GeneralSettings); } //all done. close it this.Close(); }
private void Button_Click_Ok(object sender, RoutedEventArgs e) { PhoneNumber EditedPhoneNumber = Globals.ExtensionManager.PhoneNumberGet(EditedGUID); if (EditedPhoneNumber != null) { EditedPhoneNumber.SetIsRange(true); if (FontSetting != null) { EditedPhoneNumber.OnFontSettingChanged(FontSetting); } if (Servers.SelectedIndex >= 0) { EditedPhoneNumber.SetServerIPAndPort(Servers.Items.GetItemAt(Servers.SelectedIndex).ToString()); } EditedPhoneNumber.SetExtension(this.SubscriberExtension.Text); } //all done. close it this.Close(); }