Esempio n. 1
0
		/// <summary>
		/// A form for token
		/// </summary>
		/// <returns>bool true if OK was pressed, false if cancel</returns>
		public bool ShowConfigDialog() {
			DialogResult result = new SettingsForm(this).ShowDialog();
			if (result == DialogResult.OK) {
				return true;
			}
			return false;
		}
        /// <summary>
        /// A form for token
        /// </summary>
        /// <returns>bool true if OK was pressed, false if cancel</returns>
        public bool ShowConfigDialog()
        {
            SettingsForm settingsForm;
            ILanguage lang = Language.GetInstance();

            BackgroundForm backgroundForm = BackgroundForm.ShowAndWait(FlickrPlugin.Attributes.Name, lang.GetString(LangKey.communication_wait));
            try {
                settingsForm = new SettingsForm(this);
            } finally {
                backgroundForm.CloseDialog();
            }
            settingsForm.AuthToken = this.flickrToken;
            settingsForm.IsFamily = this.IsFamily;
            settingsForm.IsPublic = this.IsPublic;
            settingsForm.IsFriend = this.IsFriend;
            settingsForm.UploadFormat = this.UploadFormat.ToString();
            settingsForm.SafetyLevel = this.SafetyLevel.ToString();
            settingsForm.HiddenFromSearch = this.HiddenFromSearch.ToString();
            settingsForm.PictureDefaultSize = this.PictureDisplaySize.ToString();
            settingsForm.AfterUploadOpenHistory = this.AfterUploadOpenHistory;
            settingsForm.AfterUploadLinkToClipBoard  = this.AfterUploadLinkToClipBoard;
            DialogResult result = settingsForm.ShowDialog();
            if (result == DialogResult.OK)
            {

                this.flickrToken = settingsForm.AuthToken;
                this.IsFamily=settingsForm.IsFamily;
                this.IsPublic=settingsForm.IsPublic;
                this.IsFriend=settingsForm.IsFriend;
                this.SafetyLevel = (FlickrNet.SafetyLevel)Enum.Parse(typeof(FlickrNet.SafetyLevel), settingsForm.SafetyLevel);
                this.HiddenFromSearch = (FlickrNet.HiddenFromSearch)Enum.Parse(typeof(FlickrNet.HiddenFromSearch), settingsForm.HiddenFromSearch);
                this.UploadFormat = (OutputFormat)Enum.Parse(typeof(OutputFormat), settingsForm.UploadFormat.ToLower());
                this.PictureDisplaySize = (PictureDisplaySize)Enum.Parse(typeof(PictureDisplaySize), settingsForm.PictureDefaultSize);

                this.AfterUploadOpenHistory=settingsForm.AfterUploadOpenHistory;
                this.AfterUploadLinkToClipBoard=settingsForm.AfterUploadLinkToClipBoard;
                IniConfig.Save();
                return true;
            }
            return false;
        }