Hi, I am come back,
I try to explain my problem with the code that I have writed(The follow code was been simplified):
On the event ItemCreated...
Private Sub Calendario_ItemCreated(ByVal sender As Object, ByVal e As MindFusion.Scheduling.ItemEventArgs) Handles Calendario.ItemCreated
Try
'Oggetto / HeaderText
e.Item.HeaderText = "MyItem.."
'Dichiaro un nuovo contatto
Dim c As New Contact
'Imposto i valori del contatto appena creato
With c
.Id = e.Item.Id
.Address = "Via chiusa..."
.Email = "tavolonimarco@alice.it"
.FirstName = "MyContacts.."
.LastName = ""
.Name = ""
.Phone = "3285341..."
End With
Dim NTask As New Task
'Add the contact at the item
Me.Calendar.Contacts.Add(c)
e.Item.Contacts.Add(c)
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Critical, "Errore " & Err.Number)
End Try
End Sub
On the event ItemDeleting...
Private Sub Calendario_ItemDeleting(ByVal sender As Object, ByVal e As MindFusion.Scheduling.WinForms.ItemConfirmEventArgs) Handles Calendario.ItemDeleting
Try
'Delete the contact from the scheduler
Me.Calendar.Contacts.Remove(e.Item.Contacts(0))
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Critical, "Errore " & Err.Number)
End Try
End Sub
After having used this routines i save the new data and then recharge my project from a file XML but
the contact created before and deleted exist still on a file.
The follow code is what I used to Save and Load the data
Try
Dim myXmlTextWriter As XmlTextWriter
myXmlTextWriter = New XmlTextWriter(Percorso.ToString, System.Text.Encoding.UTF8)
myXmlTextWriter.Formatting = System.Xml.Formatting.Indented
myXmlTextWriter.WriteStartDocument(False)
myXmlTextWriter.WriteComment("Appuntamenti utente " & CodiceUtente.ToString)
myXmlTextWriter.WriteStartElement("Appointements")
myXmlTextWriter.WriteEndElement()
myXmlTextWriter.Flush()
myXmlTextWriter.Close()
Dim a As New Xml.XmlDocument
Calendar.SaveTo(MyPath.ToString, ContentType.Xml)
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Critical, "Errore " & Err.Number)
End Try
Try
Calendar.LoadFrom(MyPath.ToString, ContentType.Xml)
Catch ex As Exception
MsgBox(Err.Description, MsgBoxStyle.Critical, "Errore " & Err.Number)
End Try