コード例 #1
0
ファイル: FlickrSync.cs プロジェクト: udif/FlickrSync
        private void newUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FlickrGetToken();

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

            UpdateUser();
            LoadConfig();
            Reload();
        }
コード例 #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();
            }
        }
コード例 #3
0
ファイル: FlickrSync.cs プロジェクト: udif/FlickrSync
        private void newUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FlickrGetToken();

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

            UpdateUser();
            LoadConfig();
            Reload();
        }
コード例 #4
0
ファイル: FlickrSync.cs プロジェクト: udif/FlickrSync
        private void FlickrSync_Load(object sender, EventArgs e)
        {
            string token="";
            try {
                token=Properties.Settings.Default.FlickrToken;
                token=token.Trim();
            }
            catch(Exception)
            {
            }

            if (token.Length == 0){
                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();
            }
        }
コード例 #5
0
ファイル: FlickrSync.cs プロジェクト: udif/FlickrSync
        public void Reload()
        {
            try
            {
                li = new LocalInfo();
                li.LoadFromXML(Properties.Settings.Default.LocalInfoXml);

                treeFolders.Initialize();
                foreach (PathInfo pi in li.GetPathInfoList())
                    if (pi.ManualAdd)
                        treeFolders.AddBaseNode(pi.Path);

                ExpandOpenFolders();
            }
            catch (Exception ex)
            {
                Error("Error initializing local folders Window", ex, ErrorType.FatalError);
            }

            try
            {
                AboutBox1 about = new AboutBox1("PLEASE WAIT... LOADING YOUR SETS");
                if (!autorun)
                    about.Show();

                Application.DoEvents();

                Flickr.CacheDisabled = true;
                ri = new RemoteInfo();
                Flickr.CacheDisabled = false; // ri already has the sets lists. Cache can be used for thumbnails

                listSets.Items.Clear();
                imageListLarge.Images.Clear();
                imageListSmall.Images.Clear();

                if (autorun)
                    FillListSet(null);
                else
                    FillListSet(about.GetProgressBar());

                ValidateSets();

                Application.DoEvents();
                about.Close();
            }
            catch (Exception ex)
            {
                Error("Error obtaining flickr sets", ex, ErrorType.FatalError);
            }

            CalcTooltips();
            UpdateStatusBar();
        }
コード例 #6
0
ファイル: FlickrSync.cs プロジェクト: udif/FlickrSync
        public void Reload()
        {
            try
            {
                li = new LocalInfo();
                li.LoadFromXML(Properties.Settings.Default.LocalInfoXml);

                treeFolders.Initialize();
                foreach (PathInfo pi in li.GetPathInfoList())
                {
                    if (pi.ManualAdd)
                    {
                        treeFolders.AddBaseNode(pi.Path);
                    }
                }

                ExpandOpenFolders();
            }
            catch (Exception ex)
            {
                Error("Error initializing local folders Window", ex, ErrorType.FatalError);
            }

            try
            {
                AboutBox1 about = new AboutBox1("PLEASE WAIT... LOADING YOUR SETS");
                if (!autorun)
                {
                    about.Show();
                }

                Application.DoEvents();

                Flickr.CacheDisabled = true;
                ri = new RemoteInfo();
                Flickr.CacheDisabled = false; // ri already has the sets lists. Cache can be used for thumbnails

                listSets.Items.Clear();
                imageListLarge.Images.Clear();
                imageListSmall.Images.Clear();

                if (autorun)
                {
                    FillListSet(null);
                }
                else
                {
                    FillListSet(about.GetProgressBar());
                }

                ValidateSets();

                Application.DoEvents();
                about.Close();
            }
            catch (Exception ex)
            {
                Error("Error obtaining flickr sets", ex, ErrorType.FatalError);
            }

            CalcTooltips();
            UpdateStatusBar();
        }
コード例 #7
0
ファイル: FlickrSync.cs プロジェクト: udif/FlickrSync
        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();
            }
        }