Ejemplo n.º 1
0
        private void btnLogIn_Click(object sender, EventArgs e)
        {
            try
            {
                bool isValid = ValidateControls();

                if (!isValid)
                    return;

                owdCloudCalendarConnector connector = new owdCloudCalendarConnector();

                string url = txtServerAddress.Text.Trim() + cLogInUrlExtension;
                if (!connector.CheckCredentials(url, txtUsername.Text.Trim(), txtPassword.Text.Trim()))
                {
                    ShowMessage("There is a problem with connection to server. Please, check server address, username and password and try again.", "ownCloud Login Unavailable");
                }
                else
                {
                    Hide();
                    SyncCalendar syncCalendar = new SyncCalendar(txtServerAddress.Text.Trim(), txtUsername.Text.Trim(), txtPassword.Text.Trim());
                    syncCalendar.ShowDialog();
                    if (syncCalendar.IsHiden)
                    {
                        Hide();
                    }
                    else
                    {
                        Close();
                    }
                }
            }
            catch (Exception ex)
            {
                HandleException(ex);
            }
        }
        private IICalendarCollection GetCalendarEventsData()
        {
            owdCloudCalendarConnector connector = new owdCloudCalendarConnector();

            string url = serverAddress + cCalDavUrlExtension + username + cCalDavUrlExtensionSlash + txtCalendarName.Text.Trim().ToLower() + cCalDavUrlExtensionExport;
            serverUrl = new Uri(url);

            return connector.ownCloudCalendar_GetEvents(serverUrl, username, password);
        }
        private IICalendarCollection GetCalendarEventsData()
        {
            owdCloudCalendarConnector connector = new owdCloudCalendarConnector();

            return connector.ownCloudCalendar_GetEvents(ServerUrl, Username, Password);
        }