Public Class Main

    Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
        Application.Exit()
    End Sub

    Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
        Dim repl As New Data.SqlServerCe.SqlCeReplication()


        repl.InternetUrl = "http://demos2005/WebSync/sqlcesa30.dll"
        repl.Publisher = "DEMOS2005"
        repl.PublisherDatabase = "SmartEstate"
        repl.PublisherSecurityMode = Data.SqlServerCe.SecurityType.DBAuthentication
        repl.PublisherLogin = "sa"
        repl.PublisherPassword = "saricky"

        repl.Publication = "SmartEstatePub"

        repl.InternetLogin = ""
        repl.InternetPassword = ""


        repl.Subscriber = "SmartEstateSub"


        repl.SubscriberConnectionString = "Data Source=""\Programmi\SmartEstateMobile\SmartEstate.sdf"";Max Database Size=128;Default Lock Escalation =100;"

        repl.ExchangeType = Data.SqlServerCe.ExchangeType.BiDirectional


        Try
            repl.Synchronize()
            MessageBox.Show("Sincronizzazione terminata")
        Catch err As Data.SqlServerCe.SqlCeException
            MessageBox.Show(err.ToString)
        End Try

    End Sub

    Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
        Dim frm As New Immobili

        Cursor.Current = Cursors.WaitCursor
        frm.ShowDialog()
    End Sub

    Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
        Dim proPath As String = System.Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
        MessageBox.Show(proPath)
    End Sub
End Class