private void OptionsForm_Load(object sender, EventArgs e)
        {
            this.ACancelButton.Text = WinFormStrings.OFCancelButtonStrRes;
            this.Text = WinFormStrings.OFCaption;
            this.label1.Text = WinFormStrings.OFlabel1StrRes;
            this.label2.Text = WinFormStrings.OFlabel2StrRes;
            this.label3.Text = WinFormStrings.OFlabel3StrRes;
            this.label8.Text = WinFormStrings.OFlabel8StrRes;
            this.OKButton.Text = WinFormStrings.OFOKButtonStrRes;
            this.SetContactPathBtn.Text = WinFormStrings.OFSetContactPathBtn;

            PiwigoURLTextbox.Text = FormSettings.Default.PiwigoUrlSetting;
            PiwigoUserNameTextBox.Text = FormSettings.Default.PiwigoUserName;
            PiwigoPasswordTextBox.Text = FormSettings.Default.PiwigoPassword;
            PicasaContactsFileTextBox.Text = FormSettings.Default.PicasaContactsLocation;

            LabelAdjust AdjustLabelClass = new LabelAdjust();
            AdjustLabelClass.AdjustLabelSize(label1);
            AdjustLabelClass.AdjustLabelSize(label2);
            AdjustLabelClass.AdjustLabelSize(label3);
            AdjustLabelClass.AdjustLabelSize(label8);
            AdjustLabelClass.AdjustButtonSize(OKButton);
            AdjustLabelClass.AdjustButtonSize(ACancelButton);
            AdjustLabelClass.AdjustButtonSize(SetContactPathBtn);
        }
        private void StatusForm_Load(object sender, EventArgs e)
        {
            bool step_passed;
            XmlDocument TagList = new XmlDocument();
            XmlDocument AlbumList = new XmlDocument();
            int NewPiwigoAlbumId;
            string PiwigoVersionNumber;

            this.button1.Text = WinFormStrings.SFbutton1StrRes;
            this.Text = WinFormStrings.SFCaptionsStrRes;
            this.label1.Text = WinFormStrings.SFlabel1StrRes;

            LabelAdjust AdjustLabelClass = new LabelAdjust();
            AdjustLabelClass.AdjustLabelSize(label1);
            AdjustLabelClass.AdjustButtonSize(button1);

            DialogResult = DialogResult.Yes;
            this.Show();
            StatusRefresh();

            //4.  Retrieve tags
            //SetStatus("Retrieving tags...");
            //step_passed = UpdateStatus(SyncPiwigoGetTags(ref TagList));
            //if (!step_passed)
               // {
            //    return;
            //}

            switch (command_to_run)
            {
                case constants.COMMAND_START_UP:
                    WriteLog("Start up");

                    //1.  Reading Picasa contacts
                    SetStatus(WinFormStrings.ReadContactsFileStrRes);
                    step_passed = UpdateStatus((SyncPiwigoReadPicasaContacts()));
                    if (stop_button_pressed)
                    {
                        return;
                    }
                    if (!step_passed)
                    {
                        return;
                    }

                    //2.  Validate that server can be reached
                    SetStatus(WinFormStrings.CheckServerConnStrRes);
                    step_passed = UpdateStatus((SyncPiwigoCheckServerStatus()));
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //3.  Login
                    SetStatus(WinFormStrings.LogInStrRes);
                    step_passed = UpdateStatus(SyncPiwigoLogIn());
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //4.  Get Piwigo Version
                    PiwigoVersionNumber = "";
                    SetStatus(WinFormStrings.GetPiwigoVersionStrRes);
                    step_passed = UpdateStatus(SyncPiwigoGetVersion(ref PiwigoVersionNumber));
                    if (stop_button_pressed)
                    {
                        return;
                    }
                    GlobalClass.PiwigoVersionNumber = PiwigoVersionNumber;

                    //5.  Get list of albums
                    SetStatus(WinFormStrings.RetrieveAlbumListStRes);
                    step_passed = UpdateStatus(SyncPiwigoGetAlbums(ref AlbumList));
                    if (step_passed)
                    {
                        GlobalClass.AlbumList = AlbumList;
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }
                break;

                case constants.COMMAND_ADD_TO_ALBUM:
                    WriteLog("Add to Album");

                    //1.  Validate that server can be reached
                    SetStatus(WinFormStrings.CheckServerConnStrRes);
                    step_passed = UpdateStatus((SyncPiwigoCheckServerStatus()));
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //2.  Login
                    SetStatus(WinFormStrings.LogInStrRes);
                    step_passed = UpdateStatus(SyncPiwigoLogIn());
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //3.  upload photos
                    NewPiwigoAlbumId = GlobalClass.AddAlbumCategoryID;
                    SetStatus(WinFormStrings.UploadPhotosStrRes);
                    step_passed = UpdateStatus(SyncPiwigoAddPhoto(NewPiwigoAlbumId));
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                break;

                case constants.COMMAND_NEW_ALBUM:
                    WriteLog("New Album");

                    //1.  Validate that server can be reached
                    SetStatus(WinFormStrings.CheckServerConnStrRes);
                    step_passed = UpdateStatus((SyncPiwigoCheckServerStatus()));
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //2.  Login
                    SetStatus(WinFormStrings.LogInStrRes);
                    step_passed = UpdateStatus(SyncPiwigoLogIn());
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //3. Create new album
                    SetStatus(WinFormStrings.CreateNewAlbumRes);
                    NewPiwigoAlbumId = -1;
                    step_passed = UpdateStatus(SyncPiwigoCreateAlbum(ref NewPiwigoAlbumId));
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                    //4.  upload photos
                    SetStatus(WinFormStrings.UploadPhotosStrRes);
                    step_passed = UpdateStatus(SyncPiwigoAddPhoto(NewPiwigoAlbumId));
                    if (!step_passed)
                    {
                        return;
                    }
                    if (stop_button_pressed)
                    {
                        return;
                    }

                break;
            }
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            int command_length, i;

            this.AddToAlbumGroupbox.Text = WinFormStrings.MFAddToAlbumGroupboxStrRes;
            this.AddTopAlbumCheckbox.Text = WinFormStrings.MFAddTopAlbumCheckboxStrRes;
            this.label1.Text = WinFormStrings.MFlabelStrRes;
            this.label2.Text = WinFormStrings.MFlabel2StrRes;
            this.label3.Text = WinFormStrings.MFlabel3StrRes;
            this.label4.Text = WinFormStrings.MFlabel4StrRes;
            this.label5.Text = WinFormStrings.MFlabel5StrRes;
            this.NewAlbumGroupBox.Text = WinFormStrings.MFNewAlbumGroupBoxStrRes;
            this.NewAlbumRadioButton.Text = WinFormStrings.MFNewAlbumRadioButtonStrRes;
            this.OptionsButton.Text = WinFormStrings.MFOptionsButtonStrRes;
            this.SyncButton.Text = WinFormStrings.MFSyncButtonStrRes;
            this.Text = WinFormStrings.MFVersionStrRes;
            this.AccessComboBox.Items.Add(WinFormStrings.PublicStrRes);
            this.AccessComboBox.Items.Add(WinFormStrings.PrivateStrRes);

            LabelAdjust AdjustLabelClass = new LabelAdjust();
            AdjustLabelClass.AdjustLabelSize(label1);
            AdjustLabelClass.AdjustLabelSize(label2);
            AdjustLabelClass.AdjustLabelSize(label3);
            AdjustLabelClass.AdjustLabelSize(label4);
            AdjustLabelClass.AdjustRadioButtonSize(NewAlbumRadioButton);
            AdjustLabelClass.AdjustRadioButtonSize(AddTopAlbumCheckbox);
            AdjustLabelClass.AdjustButtonSize(SyncButton);
            AdjustLabelClass.AdjustButtonSize(OptionsButton);

            this.SyncButton.Enabled = false;
            this.Show();
            this.Refresh();

            //if no arguments then exit
            if (command_line_args.Length == 0)
            {
                Application.Exit();
            }

            command_length = 0;
            for (i = 0; i < command_line_args.Length; i++)
            {
                command_length += command_line_args[i].Length;
            }

            if (command_length >= ((32 * 1024) - 512))
            {
                MessageBox.Show(WinFormStrings.CommandLineTooLongStrRes, "Picasa2Piwigo");
                Application.Exit();
            }

            AccessComboBox.SelectedIndex = Form1Settings.Default.AccessSetting;
            this.SyncButton.Enabled = true;
            //determine album name, if possible
            AlbumNameTextBox.Text = DetermineAlbumNameFromCommandLine(command_line_args[0]);

            //determine album description, if possible
            DescriptionTextBox.Text = DetermineAlbumDescription(command_line_args[0]);

            if (FormSettings.Default.PiwigoUrlSetting.Length == 0 ||
                FormSettings.Default.PicasaContactsLocation.Length == 0)
            {
                MessageBox.Show(WinFormStrings.SetUpConnStrRes, "Picasa2Piwigo");
                return;
            }

            //ok to try to login etc
            LoginBuildAlbumList();

            //populate album listbox
            PopulateAlbumListBox();

            //see if there's a hint in the pathname to an existing parent album
            DetermineParentAlbum(command_line_args[0]);
        }