StringToMsgLevel() public static method

public static StringToMsgLevel ( string str ) : MessagesLevel
str string
return MessagesLevel
Example #1
0
        private void preferencesToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Preferences pref = new Preferences();

            if (pref.ShowDialog() == DialogResult.OK)
            {
                messages_level = FlickrSync.StringToMsgLevel(Properties.Settings.Default.MessageLevel);
                log_level      = FlickrSync.StringToLogLevel(Properties.Settings.Default.LogLevel);
                if (autorun)
                {
                    messages_level = MessagesLevel.MessagesNone;
                }
            }
        }
Example #2
0
        private void FlickrSync_Load(object sender, EventArgs e)
        {
            string token = "";

            try {
                token = Properties.Settings.Default.FlickrToken;
            }
            catch (Exception)
            {
            }

            if (token == "")
            {
                FlickrGetToken();
            }

            messages_level = FlickrSync.StringToMsgLevel(Properties.Settings.Default.MessageLevel);
            log_level      = FlickrSync.StringToLogLevel(Properties.Settings.Default.LogLevel);
            if (autorun)
            {
                messages_level = MessagesLevel.MessagesNone;
            }

            // ri is needed to get the user. TODO: Get User without using ri
            ri = new RemoteInfo();

            UpdateUser();
            LoadConfig();
            Reload();
            FlickrSync.Log(LogLevel.LogBasic, "Application loaded");

            if (autorun)
            {
                WindowState = FormWindowState.Minimized;
            }
            else
            {
                WindowState = FormWindowState.Maximized;
            }

            if (autorun)
            {
                ViewAndSync();
                Close();
            }
        }
Example #3
0
        private void Preferences_Load(object sender, EventArgs e)
        {
            comboBoxMethod.SelectedIndex        = (int)SyncFolder.StringToMethod(Properties.Settings.Default.Method);
            comboBoxOrderType.SelectedIndex     = (int)SyncFolder.StringToOrderType(Properties.Settings.Default.OrderType);
            checkBoxNoDelete.Checked            = Properties.Settings.Default.NoDelete;
            checkBoxNoDeleteTags.Checked        = Properties.Settings.Default.NoDeleteTags;
            checkBoxShowThumbnailImages.Checked = Properties.Settings.Default.UseThumbnailImages;

            checkBoxUseProxy.Checked = Properties.Settings.Default.ProxyUse;
            SetProxyState();
            textBoxProxyHost.Text = Properties.Settings.Default.ProxyHost;
            textBoxProxyPort.Text = Properties.Settings.Default.ProxyPort;
            textBoxProxyUser.Text = Properties.Settings.Default.ProxyUser;
            textBoxProxyPass.Text = Properties.Settings.Default.ProxyPass;

            comboBoxMsgLevel.SelectedIndex = (int)FlickrSync.StringToMsgLevel(Properties.Settings.Default.MessageLevel);
            comboBoxLogLevel.SelectedIndex = (int)FlickrSync.StringToLogLevel(Properties.Settings.Default.LogLevel);
            labelLogFile.Text = Properties.Settings.Default.LogFile;

            buttonLogFile.Visible = (((FlickrSync.LogLevel)comboBoxLogLevel.SelectedIndex) != FlickrSync.LogLevel.LogNone);
            labelLogFile.Visible  = (((FlickrSync.LogLevel)comboBoxLogLevel.SelectedIndex) != FlickrSync.LogLevel.LogNone);
        }
Example #4
0
        private void FlickrSync_Load(object sender, EventArgs e)
        {
            // probably not needed but just to make sure no message from previous versions is shown
            if (Properties.Settings.Default.MessageId.CompareTo("090130_0000") < 0)
            {
                Properties.Settings.Default.MessageId = "090130_0000";
                Properties.Settings.Default.Save();
            }

            HashUsers = new ArrayList();

            OAuthAccessToken token = null;

            try {
                token = Properties.Settings.Default.OAuthToken;
            }
            catch (Exception)
            {
            }

            if (token == null)
            {
                FlickrGetToken();
            }

            messages_level = FlickrSync.StringToMsgLevel(Properties.Settings.Default.MessageLevel);
            log_level      = FlickrSync.StringToLogLevel(Properties.Settings.Default.LogLevel);
            if (autorun)
            {
                messages_level = MessagesLevel.MessagesNone;
            }

            // ri is needed to get the user. TODO: Get User without using ri
            try
            {
                ri = new RemoteInfo();
            }
            catch (FlickrNet.Exceptions.LoginFailedInvalidTokenException)
            {
                FlickrGetToken();
                ri = new RemoteInfo();
            }

            UpdateUser();
            LoadConfig();
            Reload();
            FlickrSync.Log(LogLevel.LogBasic, "Application loaded");

            if (autorun)
            {
                WindowState = FormWindowState.Minimized;
            }
            else
            {
                WindowState = FormWindowState.Maximized;
            }

            if (!message_tested)
            {
                try
                {
                    webBrowser1.Navigate(Properties.Settings.Default.MessageUrl + "?version=" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
                }
                catch (Exception)
                {
                }
            }

            if (autorun)
            {
                ViewAndSync();
                Close();
            }
        }