Compare commits

..
2 Commits
Author SHA1 Message Date
Christopher Kirchhöfer fefef83a32 Encoding in UTF8 (ohne -BOM) Geändert. System.Text.Encoding.UTF8 ist standardmäßig mit -BOM, was beim Import in Android-Handys Probleme machte 2025-01-07 15:31:13 +01:00
wombat b16cf3d860 Ical.Net für den Export eingebaut.
Der Export enthält scheinbar jetzt keinerlei Zeitzonendaten
Import in Google, Outlook und auf der HP hat funktioniert
2025-01-05 20:02:47 +01:00
4 changed files with 41 additions and 2 deletions

No files matched your search

+9
View File
@@ -102,14 +102,23 @@
<Reference Include="DevExpress.XtraSpreadsheet.v24.1, Version=24.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL" />
<Reference Include="DevExpress.XtraTreeList.v24.1, Version=24.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="DevExpress.XtraTreeMap.v24.1, Version=24.1.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" />
<Reference Include="Ical.Net, Version=4.3.1.0, Culture=neutral, PublicKeyToken=65c0446cd019ea53, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.4.3.1\lib\netstandard2.0\Ical.Net.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NodaTime, Version=3.2.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL">
<HintPath>..\packages\NodaTime.3.2.0\lib\netstandard2.0\NodaTime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
+1 -1
View File
@@ -364,7 +364,7 @@ Partial Class frmMain
Me.schedStorage.Appointments.Labels.CreateNewLabel(8, "Birthday", "&Birthday", System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(207, Byte), Integer), CType(CType(233, Byte), Integer)))
Me.schedStorage.Appointments.Labels.CreateNewLabel(9, "Anniversary", "&Anniversary", System.Drawing.Color.FromArgb(CType(CType(141, Byte), Integer), CType(CType(233, Byte), Integer), CType(CType(223, Byte), Integer)))
Me.schedStorage.Appointments.Labels.CreateNewLabel(10, "Phone Call", "Phone &Call", System.Drawing.Color.FromArgb(CType(CType(255, Byte), Integer), CType(CType(247, Byte), Integer), CType(CType(165, Byte), Integer)))
Me.schedStorage.TimeZoneId = "UTC"
Me.schedStorage.TimeZoneId = "E. Europe Standard Time"
'
'SFD
'
+28 -1
View File
@@ -9,6 +9,8 @@ Imports DevExpress.XtraGrid.Views.Base
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraScheduler
Imports DevExpress.XtraScheduler.iCalendar
Imports Ical.Net.DataTypes
Imports Ical.Net.Serialization
Imports Microsoft.Office.Interop
Public Class frmMain
@@ -260,7 +262,8 @@ Public Class frmMain
AddHandler exporter.AppointmentExporting, AddressOf Exporter_AppointmentExporting
Dim failed As Boolean
Try
exporter.Export(SFD.FileName)
'exporter.Export(SFD.FileName)
IcalNetTest(SFD.FileName)
Catch ex As Exception
failed = True
End Try
@@ -268,6 +271,26 @@ Public Class frmMain
End If
End Sub
Private Sub IcalNetTest(OutputFile As String)
Dim calendar As New Ical.Net.Calendar
For Each evt As EventEntry In ds.Where(Function(e) e.IsInvalid = False AndAlso e.Exclude = False)
calendar.Events.Add(New Ical.Net.CalendarComponents.CalendarEvent With {
.Start = New CalDateTime(evt.StartDate),
.[End] = New CalDateTime(evt.EndDate),
.IsAllDay = evt.AllDay,
.Location = evt.Location,
.Summary = evt.Subject '.Categories = {evt.Category} Kategorien machen beim Import in Joomla JEvents probleme
})
Next
Dim serializer As New CalendarSerializer
Dim utf8WithoutBom As New System.Text.UTF8Encoding(False)
Using sw As New StreamWriter(OutputFile, False, utf8WithoutBom) 'NICHT einfach System.Text.Encoding.UTF8 nehmen, da dann als UTF8-BOM gespeichert wird und der Import z.B. Bei Samsung/Android-Handys nicht funktioniert
sw.Write(serializer.SerializeToString(calendar))
End Using
End Sub
Private Sub Exporter_AppointmentExporting(sender As Object, e As AppointmentExportingEventArgs)
'e.Appointment.TimeZoneId = sched.OptionsBehavior.ClientTimeZoneId
'e.Appointment.TimeZoneId = General.Settings.DefaultTimezoneId
@@ -300,4 +323,8 @@ Public Class frmMain
xlsSheet.SelectedCell = activeSheet.Cells($"A{grdv.GetFocusedRowCellValue("RowIndex")}")
activeSheet.ScrollTo(activeSheet.SelectedCell)
End Sub
Private Sub FluentDesignFormControl1_Click(sender As Object, e As EventArgs) Handles FluentDesignFormControl1.Click
End Sub
End Class
+3
View File
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Ical.Net" version="4.3.1" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
<package id="NodaTime" version="3.2.0" targetFramework="net48" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net48" />
</packages>