Moving from aspose.iCalendar to aspose.email.mail.Calendaring

Hi I am trying to migrate an old system which used the aspose.iCalendar version 1.1.1.0 , now I replaced this dll with the aspose.Email.Mail.Calendaring


I have the following code

Option Strict On
Option Explicit On

Imports System.Data.SqlClient
Imports Aspose.Email.Mail.Calendaring

Namespace RNIntranet


Public Class CMSRecurrence
Private _iRecurrenceID As Integer
Private _ds As DataSet
Private _dbConn As SqlConnection
'Private _RecurrencePattern As RNRecurrencePattern
Private _RecurrencePattern As RecurrencePattern


#Region “Public Properties”


Public ReadOnly Property RecurrenceID() As Integer
Get
Return _iRecurrenceID
End Get
End Property
Public Property ICalendarString() As String
Get
If IsDBNull(_ds.Tables(0).Rows(0)(“ICalendar”)) Then
Return “”
Else
Return CStr(_ds.Tables(0).Rows(0)(“ICalendar”))
End If
End Get
Set(ByVal Value As String)
_ds.Tables(0).Rows(0)(“ICalendar”) = Value
_RecurrencePattern = New RecurrencePattern(Value)
End Set
End Property

the highlighted line raises an error as the RecurrencePattern is defined as an abstract class now

what would be an alternative solution to generate the RecurrencePattern the same way above?

Hi Alireza,

Thank you for writing to Aspose support team.

You can use the following sample code for generating Recurrence Pattern.Apose.iCalendar.RecurrencePattern provides the capability to generate such recurrences. Please try it at your end and share your feedback with us in case you face any difficulty.

Code:

RecurrencePattern asposeProvider = new RecurrencePattern();
asposeProvider.StartDate = new DateTime(2014, 2, 12);
RecurrenceRule rule = asposeProvider.RRules.Add();
rule.Frequency = Frequency.Daily;
rule.Interval = 3;
DateCollection predictedDates = asposeProvider.GenerateOccurrences(2);