From 6c0eaa0de82a6c382b70dc11bd5fde91b7814951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Thu, 20 Feb 2025 14:45:27 +0100 Subject: [PATCH] ICAL QR code eingebaut --- QR-Code-Generator/Main.Designer.cs | 610 ++++++++++++++++++----------- QR-Code-Generator/Main.cs | 51 ++- 2 files changed, 425 insertions(+), 236 deletions(-) diff --git a/QR-Code-Generator/Main.Designer.cs b/QR-Code-Generator/Main.Designer.cs index f16f9c8..e28fa34 100644 --- a/QR-Code-Generator/Main.Designer.cs +++ b/QR-Code-Generator/Main.Designer.cs @@ -34,6 +34,31 @@ label1 = new Label(); textBox_URL = new TextBox(); tabPage2 = new TabPage(); + textBox_country = new TextBox(); + label12 = new Label(); + label13 = new Label(); + label14 = new Label(); + label15 = new Label(); + label8 = new Label(); + label9 = new Label(); + label10 = new Label(); + label11 = new Label(); + label6 = new Label(); + label7 = new Label(); + label5 = new Label(); + label4 = new Label(); + textBox_zipCode = new TextBox(); + textBox_city = new TextBox(); + textBox_houseNumber = new TextBox(); + textBox_street = new TextBox(); + textBox_website = new TextBox(); + textBox_email = new TextBox(); + textBox_workPhone = new TextBox(); + textBox_mobilePhone = new TextBox(); + textBox_phone = new TextBox(); + textBox_nickname = new TextBox(); + textBox_lastname = new TextBox(); + textBox_firstname = new TextBox(); bt_createQRAdress = new Button(); tabPage3 = new TabPage(); radioButton_NoPass = new RadioButton(); @@ -45,6 +70,18 @@ textBox_ssid = new TextBox(); checkBox_isHidden = new CheckBox(); bt_createQR_WIFI = new Button(); + tabPage4 = new TabPage(); + ICAL_location = new TextBox(); + ICAL_summary = new TextBox(); + ICAL_description = new TextBox(); + ICAL_ende = new DateTimePicker(); + ICAL_start = new DateTimePicker(); + label16 = new Label(); + label18 = new Label(); + label19 = new Label(); + label20 = new Label(); + lb_ical_summary = new Label(); + bt_createQR_ICAL = new Button(); pb_QRC = new PictureBox(); button1 = new Button(); pb_icon = new PictureBox(); @@ -55,35 +92,12 @@ panel_ColorDark = new Panel(); button_ChangeColorLight = new Button(); button_ChangeColorDark = new Button(); - textBox_firstname = new TextBox(); - textBox_lastname = new TextBox(); - textBox_nickname = new TextBox(); - textBox_workPhone = new TextBox(); - textBox_mobilePhone = new TextBox(); - textBox_phone = new TextBox(); - textBox_zipCode = new TextBox(); - textBox_city = new TextBox(); - textBox_houseNumber = new TextBox(); - textBox_street = new TextBox(); - textBox_website = new TextBox(); - textBox_email = new TextBox(); - label4 = new Label(); - label5 = new Label(); - label6 = new Label(); - label7 = new Label(); - label8 = new Label(); - label9 = new Label(); - label10 = new Label(); - label11 = new Label(); - label12 = new Label(); - label13 = new Label(); - label14 = new Label(); - label15 = new Label(); - textBox_country = new TextBox(); + ICAL_fullday = new CheckBox(); tabControl1.SuspendLayout(); tabPage1.SuspendLayout(); tabPage2.SuspendLayout(); tabPage3.SuspendLayout(); + tabPage4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)pb_QRC).BeginInit(); ((System.ComponentModel.ISupportInitialize)pb_icon).BeginInit(); SuspendLayout(); @@ -93,6 +107,7 @@ tabControl1.Controls.Add(tabPage1); tabControl1.Controls.Add(tabPage2); tabControl1.Controls.Add(tabPage3); + tabControl1.Controls.Add(tabPage4); tabControl1.Location = new Point(12, 12); tabControl1.Name = "tabControl1"; tabControl1.SelectedIndex = 0; @@ -175,6 +190,205 @@ tabPage2.Text = "Adresse"; tabPage2.UseVisualStyleBackColor = true; // + // textBox_country + // + textBox_country.Location = new Point(155, 366); + textBox_country.Name = "textBox_country"; + textBox_country.Size = new Size(251, 23); + textBox_country.TabIndex = 25; + // + // label12 + // + label12.AutoSize = true; + label12.Location = new Point(6, 366); + label12.Name = "label12"; + label12.Size = new Size(44, 15); + label12.TabIndex = 24; + label12.Text = "label12"; + // + // label13 + // + label13.AutoSize = true; + label13.Location = new Point(6, 337); + label13.Name = "label13"; + label13.Size = new Size(44, 15); + label13.TabIndex = 23; + label13.Text = "label13"; + // + // label14 + // + label14.AutoSize = true; + label14.Location = new Point(6, 308); + label14.Name = "label14"; + label14.Size = new Size(44, 15); + label14.TabIndex = 22; + label14.Text = "label14"; + // + // label15 + // + label15.AutoSize = true; + label15.Location = new Point(6, 279); + label15.Name = "label15"; + label15.Size = new Size(44, 15); + label15.TabIndex = 21; + label15.Text = "label15"; + // + // label8 + // + label8.AutoSize = true; + label8.Location = new Point(6, 250); + label8.Name = "label8"; + label8.Size = new Size(38, 15); + label8.TabIndex = 20; + label8.Text = "label8"; + // + // label9 + // + label9.AutoSize = true; + label9.Location = new Point(6, 221); + label9.Name = "label9"; + label9.Size = new Size(38, 15); + label9.TabIndex = 19; + label9.Text = "label9"; + // + // label10 + // + label10.AutoSize = true; + label10.Location = new Point(6, 192); + label10.Name = "label10"; + label10.Size = new Size(44, 15); + label10.TabIndex = 18; + label10.Text = "label10"; + // + // label11 + // + label11.AutoSize = true; + label11.Location = new Point(6, 163); + label11.Name = "label11"; + label11.Size = new Size(44, 15); + label11.TabIndex = 17; + label11.Text = "label11"; + // + // label6 + // + label6.AutoSize = true; + label6.Location = new Point(6, 134); + label6.Name = "label6"; + label6.Size = new Size(38, 15); + label6.TabIndex = 16; + label6.Text = "label6"; + // + // label7 + // + label7.AutoSize = true; + label7.Location = new Point(6, 105); + label7.Name = "label7"; + label7.Size = new Size(61, 15); + label7.TabIndex = 15; + label7.Text = "Nickname"; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new Point(6, 76); + label5.Name = "label5"; + label5.Size = new Size(65, 15); + label5.TabIndex = 14; + label5.Text = "Nachname"; + // + // label4 + // + label4.AutoSize = true; + label4.Location = new Point(6, 47); + label4.Name = "label4"; + label4.Size = new Size(54, 15); + label4.TabIndex = 13; + label4.Text = "Vorname"; + // + // textBox_zipCode + // + textBox_zipCode.Location = new Point(155, 337); + textBox_zipCode.Name = "textBox_zipCode"; + textBox_zipCode.Size = new Size(251, 23); + textBox_zipCode.TabIndex = 12; + // + // textBox_city + // + textBox_city.Location = new Point(155, 308); + textBox_city.Name = "textBox_city"; + textBox_city.Size = new Size(251, 23); + textBox_city.TabIndex = 11; + // + // textBox_houseNumber + // + textBox_houseNumber.Location = new Point(341, 279); + textBox_houseNumber.Name = "textBox_houseNumber"; + textBox_houseNumber.Size = new Size(65, 23); + textBox_houseNumber.TabIndex = 10; + // + // textBox_street + // + textBox_street.Location = new Point(155, 279); + textBox_street.Name = "textBox_street"; + textBox_street.Size = new Size(180, 23); + textBox_street.TabIndex = 9; + // + // textBox_website + // + textBox_website.Location = new Point(155, 247); + textBox_website.Name = "textBox_website"; + textBox_website.Size = new Size(251, 23); + textBox_website.TabIndex = 8; + // + // textBox_email + // + textBox_email.Location = new Point(155, 218); + textBox_email.Name = "textBox_email"; + textBox_email.Size = new Size(251, 23); + textBox_email.TabIndex = 7; + // + // textBox_workPhone + // + textBox_workPhone.Location = new Point(155, 189); + textBox_workPhone.Name = "textBox_workPhone"; + textBox_workPhone.Size = new Size(251, 23); + textBox_workPhone.TabIndex = 6; + // + // textBox_mobilePhone + // + textBox_mobilePhone.Location = new Point(155, 160); + textBox_mobilePhone.Name = "textBox_mobilePhone"; + textBox_mobilePhone.Size = new Size(251, 23); + textBox_mobilePhone.TabIndex = 5; + // + // textBox_phone + // + textBox_phone.Location = new Point(155, 131); + textBox_phone.Name = "textBox_phone"; + textBox_phone.Size = new Size(251, 23); + textBox_phone.TabIndex = 4; + // + // textBox_nickname + // + textBox_nickname.Location = new Point(155, 102); + textBox_nickname.Name = "textBox_nickname"; + textBox_nickname.Size = new Size(251, 23); + textBox_nickname.TabIndex = 3; + // + // textBox_lastname + // + textBox_lastname.Location = new Point(155, 73); + textBox_lastname.Name = "textBox_lastname"; + textBox_lastname.Size = new Size(251, 23); + textBox_lastname.TabIndex = 2; + // + // textBox_firstname + // + textBox_firstname.Location = new Point(155, 44); + textBox_firstname.Name = "textBox_firstname"; + textBox_firstname.Size = new Size(251, 23); + textBox_firstname.TabIndex = 1; + // // bt_createQRAdress // bt_createQRAdress.Location = new Point(6, 552); @@ -288,6 +502,124 @@ bt_createQR_WIFI.UseVisualStyleBackColor = true; bt_createQR_WIFI.Click += bt_createQR_WIFI_Click; // + // tabPage4 + // + tabPage4.Controls.Add(ICAL_fullday); + tabPage4.Controls.Add(ICAL_location); + tabPage4.Controls.Add(ICAL_summary); + tabPage4.Controls.Add(ICAL_description); + tabPage4.Controls.Add(ICAL_ende); + tabPage4.Controls.Add(ICAL_start); + tabPage4.Controls.Add(label16); + tabPage4.Controls.Add(label18); + tabPage4.Controls.Add(label19); + tabPage4.Controls.Add(label20); + tabPage4.Controls.Add(lb_ical_summary); + tabPage4.Controls.Add(bt_createQR_ICAL); + tabPage4.Location = new Point(4, 24); + tabPage4.Name = "tabPage4"; + tabPage4.Padding = new Padding(3); + tabPage4.Size = new Size(412, 581); + tabPage4.TabIndex = 3; + tabPage4.Text = "Termin"; + tabPage4.UseVisualStyleBackColor = true; + // + // ICAL_location + // + ICAL_location.Location = new Point(106, 45); + ICAL_location.Name = "ICAL_location"; + ICAL_location.Size = new Size(290, 23); + ICAL_location.TabIndex = 29; + // + // ICAL_summary + // + ICAL_summary.Location = new Point(106, 16); + ICAL_summary.Name = "ICAL_summary"; + ICAL_summary.Size = new Size(290, 23); + ICAL_summary.TabIndex = 28; + // + // ICAL_description + // + ICAL_description.Location = new Point(106, 150); + ICAL_description.Multiline = true; + ICAL_description.Name = "ICAL_description"; + ICAL_description.Size = new Size(290, 276); + ICAL_description.TabIndex = 27; + // + // ICAL_ende + // + ICAL_ende.CustomFormat = "dd.MM.yyy HH:mm"; + ICAL_ende.Format = DateTimePickerFormat.Custom; + ICAL_ende.Location = new Point(106, 119); + ICAL_ende.Name = "ICAL_ende"; + ICAL_ende.Size = new Size(141, 23); + ICAL_ende.TabIndex = 26; + // + // ICAL_start + // + ICAL_start.CustomFormat = "dd.MM.yyy HH:mm"; + ICAL_start.Format = DateTimePickerFormat.Custom; + ICAL_start.Location = new Point(106, 82); + ICAL_start.Name = "ICAL_start"; + ICAL_start.Size = new Size(141, 23); + ICAL_start.TabIndex = 25; + ICAL_start.ValueChanged += ICAL_start_ValueChanged; + // + // label16 + // + label16.AutoSize = true; + label16.Location = new Point(6, 164); + label16.Name = "label16"; + label16.Size = new Size(79, 15); + label16.TabIndex = 24; + label16.Text = "Beschreibung"; + // + // label18 + // + label18.AutoSize = true; + label18.Location = new Point(6, 119); + label18.Name = "label18"; + label18.Size = new Size(36, 15); + label18.TabIndex = 22; + label18.Text = "Ende:"; + // + // label19 + // + label19.AutoSize = true; + label19.Location = new Point(6, 90); + label19.Name = "label19"; + label19.Size = new Size(47, 15); + label19.TabIndex = 21; + label19.Text = "Beginn:"; + // + // label20 + // + label20.AutoSize = true; + label20.Location = new Point(6, 48); + label20.Name = "label20"; + label20.Size = new Size(27, 15); + label20.TabIndex = 20; + label20.Text = "Ort:"; + // + // lb_ical_summary + // + lb_ical_summary.AutoSize = true; + lb_ical_summary.Location = new Point(6, 19); + lb_ical_summary.Name = "lb_ical_summary"; + lb_ical_summary.Size = new Size(71, 15); + lb_ical_summary.TabIndex = 19; + lb_ical_summary.Text = "Termin Titel:"; + // + // bt_createQR_ICAL + // + bt_createQR_ICAL.Location = new Point(6, 555); + bt_createQR_ICAL.Name = "bt_createQR_ICAL"; + bt_createQR_ICAL.Size = new Size(400, 23); + bt_createQR_ICAL.TabIndex = 2; + bt_createQR_ICAL.Text = "generiere QR"; + bt_createQR_ICAL.UseVisualStyleBackColor = true; + bt_createQR_ICAL.Click += bt_createQR_ICAL_Click; + // // pb_QRC // pb_QRC.Location = new Point(517, 243); @@ -355,9 +687,9 @@ // button_ChangeColorLight.Location = new Point(509, 47); button_ChangeColorLight.Name = "button_ChangeColorLight"; - button_ChangeColorLight.Size = new Size(75, 23); + button_ChangeColorLight.Size = new Size(94, 23); button_ChangeColorLight.TabIndex = 8; - button_ChangeColorLight.Text = "button2"; + button_ChangeColorLight.Text = "helle Farbe"; button_ChangeColorLight.UseVisualStyleBackColor = true; button_ChangeColorLight.Click += button_ChangeColorLight_Click; // @@ -365,210 +697,21 @@ // button_ChangeColorDark.Location = new Point(509, 73); button_ChangeColorDark.Name = "button_ChangeColorDark"; - button_ChangeColorDark.Size = new Size(75, 23); + button_ChangeColorDark.Size = new Size(94, 23); button_ChangeColorDark.TabIndex = 9; - button_ChangeColorDark.Text = "button3"; + button_ChangeColorDark.Text = "dunkle Farbe"; button_ChangeColorDark.UseVisualStyleBackColor = true; button_ChangeColorDark.Click += button_ChangeColorDark_Click; // - // textBox_firstname + // ICAL_fullday // - textBox_firstname.Location = new Point(155, 44); - textBox_firstname.Name = "textBox_firstname"; - textBox_firstname.Size = new Size(251, 23); - textBox_firstname.TabIndex = 1; - // - // textBox_lastname - // - textBox_lastname.Location = new Point(155, 73); - textBox_lastname.Name = "textBox_lastname"; - textBox_lastname.Size = new Size(251, 23); - textBox_lastname.TabIndex = 2; - // - // textBox_nickname - // - textBox_nickname.Location = new Point(155, 102); - textBox_nickname.Name = "textBox_nickname"; - textBox_nickname.Size = new Size(251, 23); - textBox_nickname.TabIndex = 3; - // - // textBox_workPhone - // - textBox_workPhone.Location = new Point(155, 189); - textBox_workPhone.Name = "textBox_workPhone"; - textBox_workPhone.Size = new Size(251, 23); - textBox_workPhone.TabIndex = 6; - // - // textBox_mobilePhone - // - textBox_mobilePhone.Location = new Point(155, 160); - textBox_mobilePhone.Name = "textBox_mobilePhone"; - textBox_mobilePhone.Size = new Size(251, 23); - textBox_mobilePhone.TabIndex = 5; - // - // textBox_phone - // - textBox_phone.Location = new Point(155, 131); - textBox_phone.Name = "textBox_phone"; - textBox_phone.Size = new Size(251, 23); - textBox_phone.TabIndex = 4; - // - // textBox_zipCode - // - textBox_zipCode.Location = new Point(155, 337); - textBox_zipCode.Name = "textBox_zipCode"; - textBox_zipCode.Size = new Size(251, 23); - textBox_zipCode.TabIndex = 12; - // - // textBox_city - // - textBox_city.Location = new Point(155, 308); - textBox_city.Name = "textBox_city"; - textBox_city.Size = new Size(251, 23); - textBox_city.TabIndex = 11; - // - // textBox_houseNumber - // - textBox_houseNumber.Location = new Point(341, 279); - textBox_houseNumber.Name = "textBox_houseNumber"; - textBox_houseNumber.Size = new Size(65, 23); - textBox_houseNumber.TabIndex = 10; - // - // textBox_street - // - textBox_street.Location = new Point(155, 279); - textBox_street.Name = "textBox_street"; - textBox_street.Size = new Size(180, 23); - textBox_street.TabIndex = 9; - // - // textBox_website - // - textBox_website.Location = new Point(155, 247); - textBox_website.Name = "textBox_website"; - textBox_website.Size = new Size(251, 23); - textBox_website.TabIndex = 8; - // - // textBox_email - // - textBox_email.Location = new Point(155, 218); - textBox_email.Name = "textBox_email"; - textBox_email.Size = new Size(251, 23); - textBox_email.TabIndex = 7; - // - // label4 - // - label4.AutoSize = true; - label4.Location = new Point(6, 47); - label4.Name = "label4"; - label4.Size = new Size(54, 15); - label4.TabIndex = 13; - label4.Text = "Vorname"; - // - // label5 - // - label5.AutoSize = true; - label5.Location = new Point(6, 76); - label5.Name = "label5"; - label5.Size = new Size(65, 15); - label5.TabIndex = 14; - label5.Text = "Nachname"; - // - // label6 - // - label6.AutoSize = true; - label6.Location = new Point(6, 134); - label6.Name = "label6"; - label6.Size = new Size(38, 15); - label6.TabIndex = 16; - label6.Text = "label6"; - // - // label7 - // - label7.AutoSize = true; - label7.Location = new Point(6, 105); - label7.Name = "label7"; - label7.Size = new Size(61, 15); - label7.TabIndex = 15; - label7.Text = "Nickname"; - // - // label8 - // - label8.AutoSize = true; - label8.Location = new Point(6, 250); - label8.Name = "label8"; - label8.Size = new Size(38, 15); - label8.TabIndex = 20; - label8.Text = "label8"; - // - // label9 - // - label9.AutoSize = true; - label9.Location = new Point(6, 221); - label9.Name = "label9"; - label9.Size = new Size(38, 15); - label9.TabIndex = 19; - label9.Text = "label9"; - // - // label10 - // - label10.AutoSize = true; - label10.Location = new Point(6, 192); - label10.Name = "label10"; - label10.Size = new Size(44, 15); - label10.TabIndex = 18; - label10.Text = "label10"; - // - // label11 - // - label11.AutoSize = true; - label11.Location = new Point(6, 163); - label11.Name = "label11"; - label11.Size = new Size(44, 15); - label11.TabIndex = 17; - label11.Text = "label11"; - // - // label12 - // - label12.AutoSize = true; - label12.Location = new Point(6, 366); - label12.Name = "label12"; - label12.Size = new Size(44, 15); - label12.TabIndex = 24; - label12.Text = "label12"; - // - // label13 - // - label13.AutoSize = true; - label13.Location = new Point(6, 337); - label13.Name = "label13"; - label13.Size = new Size(44, 15); - label13.TabIndex = 23; - label13.Text = "label13"; - // - // label14 - // - label14.AutoSize = true; - label14.Location = new Point(6, 308); - label14.Name = "label14"; - label14.Size = new Size(44, 15); - label14.TabIndex = 22; - label14.Text = "label14"; - // - // label15 - // - label15.AutoSize = true; - label15.Location = new Point(6, 279); - label15.Name = "label15"; - label15.Size = new Size(44, 15); - label15.TabIndex = 21; - label15.Text = "label15"; - // - // textBox_country - // - textBox_country.Location = new Point(155, 366); - textBox_country.Name = "textBox_country"; - textBox_country.Size = new Size(251, 23); - textBox_country.TabIndex = 25; + ICAL_fullday.AutoSize = true; + ICAL_fullday.Location = new Point(253, 86); + ICAL_fullday.Name = "ICAL_fullday"; + ICAL_fullday.Size = new Size(78, 19); + ICAL_fullday.TabIndex = 30; + ICAL_fullday.Text = "ganztägig"; + ICAL_fullday.UseVisualStyleBackColor = true; // // Main // @@ -596,6 +739,8 @@ tabPage2.PerformLayout(); tabPage3.ResumeLayout(false); tabPage3.PerformLayout(); + tabPage4.ResumeLayout(false); + tabPage4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)pb_QRC).EndInit(); ((System.ComponentModel.ISupportInitialize)pb_icon).EndInit(); ResumeLayout(false); @@ -655,5 +800,18 @@ private TextBox textBox_lastname; private TextBox textBox_firstname; private TextBox textBox_country; + private TabPage tabPage4; + private Button bt_createQR_ICAL; + private DateTimePicker ICAL_ende; + private DateTimePicker ICAL_start; + private Label label16; + private Label label18; + private Label label19; + private Label label20; + private Label lb_ical_summary; + private TextBox ICAL_location; + private TextBox ICAL_summary; + private TextBox ICAL_description; + private CheckBox ICAL_fullday; } } diff --git a/QR-Code-Generator/Main.cs b/QR-Code-Generator/Main.cs index 5e58aee..8cf7c52 100644 --- a/QR-Code-Generator/Main.cs +++ b/QR-Code-Generator/Main.cs @@ -13,6 +13,7 @@ namespace QR_Code_Generator private Color darkColor = Color.Black; private Color lightColor = Color.White; private bool drawQuietZones = true; + private bool forceUtf8 = true; private QRCodeGenerator.ECCLevel eCCLevel = QRCodeGenerator.ECCLevel.Q; private string colorConfigFile = "colors.json"; private int iconSizePercent = 15; @@ -42,6 +43,8 @@ namespace QR_Code_Generator private void Main_Load(object sender, EventArgs e) { LoadColors(colorConfigFile); + ICAL_start.Value = DateTime.Now; + ICAL_ende.Value = DateTime.Now; } private void Main_FormClosing(object sender, FormClosingEventArgs e) @@ -70,7 +73,7 @@ namespace QR_Code_Generator } private void bt_createQRAdress_Click(object sender, EventArgs e) { - GenerateAndDisplayAdressQRCode(); + GenerateAndDisplayWLANQRCode(); } private void button_Save_QRCode_Click(object sender, EventArgs e) @@ -90,7 +93,7 @@ namespace QR_Code_Generator #endregion #region QR Code Generation - private void GenerateAndDisplayAdressQRCode() + private void GenerateAndDisplayWLANQRCode() { // Hilfsmethode, um null für leere Textboxen zurückzugeben string? GetValueOrNull(TextBox textBox) => string.IsNullOrWhiteSpace(textBox.Text) ? null : textBox.Text; @@ -98,25 +101,25 @@ namespace QR_Code_Generator // Erstellt den ContactData-Generator mit überprüften Werten ContactData generator = new ContactData( ContactData.ContactOutputType.VCard3, - textBox_firstname.Text, - textBox_lastname.Text, + textBox_firstname.Text, + textBox_lastname.Text, GetValueOrNull(textBox_nickname), GetValueOrNull(textBox_phone), GetValueOrNull(textBox_mobilePhone), GetValueOrNull(textBox_workPhone), GetValueOrNull(textBox_email), - null, + null, GetValueOrNull(textBox_website), GetValueOrNull(textBox_street), GetValueOrNull(textBox_houseNumber), GetValueOrNull(textBox_city), GetValueOrNull(textBox_zipCode), GetValueOrNull(textBox_country), - null, - null, + null, + null, ContactData.AddressOrder.Default, - null, - null + null, + null ); // Erzeuge den QR-Code @@ -162,7 +165,7 @@ namespace QR_Code_Generator private Bitmap GenerateQRCode(string payload, Color dark, Color light, QRCodeGenerator.ECCLevel eCC) { using QRCodeGenerator qrGenerator = new QRCodeGenerator(); - QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload, eCC); + QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload, eCC, forceUtf8); using QRCode qrCode = new QRCode(qrCodeData); // Prüfen, ob ein Icon vorhanden ist @@ -269,5 +272,33 @@ namespace QR_Code_Generator #endregion + private void bt_createQR_ICAL_Click(object sender, EventArgs e) + { + GenerateAndDisplayICALQRCode(); + + + + } + private void GenerateAndDisplayICALQRCode() + { + string summary = ICAL_summary.Text; + string description = ICAL_description.Text; + string location = ICAL_location.Text; + DateTime start = ICAL_start.Value; + DateTime ende = ICAL_ende.Value; + bool fullday = ICAL_fullday.CheckState == CheckState.Checked; + CalendarEvent generator = new CalendarEvent(summary, description, location, start, ende, fullday, CalendarEvent.EventEncoding.iCalComplete); + string payload = generator.ToString(); + GenerateQRCode(payload, darkColor, lightColor, eCCLevel); + pb_QRC.Image = GenerateQRCode(payload, darkColor, lightColor, eCCLevel); + + + + } + + private void ICAL_start_ValueChanged(object sender, EventArgs e) + { + ICAL_ende.Value = ICAL_start.Value.AddHours(1); + } } }