CreateUser() public method

public CreateUser ( string asdf = null ) : void
asdf string
return void
Esempio n. 1
0
        void Window_Loaded(object sender, RoutedEventArgs e)
        {
            changeUI(o3o.Properties.Settings.Default.Layout);
            if (this.CheckDwm())
            {
                this.SetAeroGlass();
            }

            this.Left   = o3o.Properties.Settings.Default.LastWindowPosition.X;
            this.Top    = o3o.Properties.Settings.Default.LastWindowPosition.Y;
            this.Height = o3o.Properties.Settings.Default.LastWindowHeight;

            this.TweetsDisplaySlider.Value = o3o.Properties.Settings.Default.amountOfTWeetsToDisplay;
            loadsounds();

            if (o3o.Properties.Settings.Default.use_system_color)
            {
                this.checkBox1.IsChecked = true;
            }

            if (o3o.Properties.Settings.Default.PlayNotificationSound)
            {
                this.SoundCheckBox.IsChecked = true;
            }

            if (o3o.Properties.Settings.Default.ShowNotificationPopup)
            {
                this.PopupCheckBox.IsChecked = true;
            }

            if (Properties.Settings.Default.TopMostNotify)
            {
                this.topmostcheckbox.IsChecked = true;
            }
            Color col = System.Windows.Media.Color.FromArgb(Properties.Settings.Default.system_color.A, Properties.Settings.Default.system_color.R, Properties.Settings.Default.system_color.G, Properties.Settings.Default.system_color.B);

            colorpicker.recContent.Fill = new SolidColorBrush(col);
            colorpicker.SelectedColor   = col;
            if (UsrDB.load() == false || UsrDB.Users.Count == 0)
            {
                UsrDB.CreateUser();
            }
            if (UsrDB.Users[0].UserDetails != null)
            {
                this.UserSelectionMenuCurrentName.Header = UsrDB.Users[0].UserDetails.ScreenName;
            }
            else
            {
                UsrDB.WipeUsers();
                System.Windows.Application.Current.Shutdown();
            }

            #region displaystuff
            this.DisplaysComboBox.SelectedIndex = o3o.Properties.Settings.Default.DisplayIndex;
            int dex;
            int upperBound = Displays.GetUpperBound(0);
            for (dex = 0; dex <= upperBound; dex++)
            {
                if (Displays[dex].Primary)
                {
                    this.DisplaysComboBox.Items.Add(dex + ": " + Displays[dex].DeviceName + " Width:" + Displays[dex].Bounds.Width.ToString() + " Height:" + Displays[dex].Bounds.Height.ToString() + " (primary)");
                }
                else
                {
                    string entry = dex + ": " + Displays[dex].DeviceName + " Width:" + Displays[dex].Bounds.Width.ToString() + " Height:" + Displays[dex].Bounds.Height.ToString();
                    System.Windows.Point primaryscreen = new System.Windows.Point(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y);
                    if (Displays[dex].Bounds.X < primaryscreen.X)
                    {
                        if (Displays[dex].Bounds.Y > primaryscreen.Y)
                        {
                            entry = entry + " (Bottom Left)";
                        }
                        else if (Displays[dex].Bounds.Y < primaryscreen.Y)
                        {
                            entry = entry + " (Top Left)";
                        }
                        else
                        {
                            entry = entry + " (Left)";
                        }
                    }
                    else if (Displays[dex].Bounds.X > primaryscreen.X)
                    {
                        if (Displays[dex].Bounds.Y > primaryscreen.Y)
                        {
                            entry = entry + " (Bottom Right)";
                        }
                        else if (Displays[dex].Bounds.Y < primaryscreen.Y)
                        {
                            entry = entry + " (Top Right)";
                        }
                        else
                        {
                            entry = entry + " (Right)";
                        }
                    }
                    else if (Displays[dex].Bounds.X == primaryscreen.X)
                    {
                        if (Displays[dex].Bounds.Y < primaryscreen.Y)
                        {
                            entry = entry + " (Bottom)";
                        }
                        else if (Displays[dex].Bounds.Y > primaryscreen.Y)
                        {
                            entry = entry + " (Top)";
                        }
                        else
                        {
                            entry = entry + " (What?)";
                        }
                    }
                    this.DisplaysComboBox.Items.Add(entry);
                }
            }
            #endregion
            maindispatcher = this.Dispatcher;
            foreach (UserDatabase.User usr in UsrDB.Users)
            {
                usr.tweetStack.NewTweet     += new TweetStack.newtweetDel(o3o_NewTweet);
                usr.tweetStack.DMReceived   += new TweetStack.DMReceivedDel(o3o_NewDM);
                usr.tweetStack.TweetDeleted += new TweetStack.TweetDeletedDel(o3o_TweetDeleted);
                usr.tweetStack.clear        += new TweetStack.clearTweetStack(o3o_clearTweetStack);
                usr.tweetStack.FetchTweets  += new TweetStack.fetchTweets(o3o_FetchTweets);
                prefetch(usr);
            }

            UpdateUserMenu(UsrDB);

            _timer           = new System.Timers.Timer(2000);
            _timer.Enabled   = true;
            _timer.AutoReset = true;
            _timer.Elapsed  += new System.Timers.ElapsedEventHandler(_timer_Elapsed);
            _timer.Start();
        }
Esempio n. 2
0
 private void addNewAccountToolStripMenuItem_Click(object sender, EventArgs e)
 {
     UsrDB.CreateUser();
     RefreshList();
 }