public static void Avtorization(string data)
 {
     if (data == "true")
     {
         SetUI.SetManyControl(new ManyPanel(), control);
     }
     else if (data == "false")
     {
         MessageBox.Show("Такого акаунта нет, пароль или логин были не правильными");
     }
 }
 public static void Registration(string data)
 {
     if (data == "true")
     {
         MessageBox.Show("Вы успешно зарегистровались");
         SetUI.SetRAControl(new Avtorisation(), control);
     }
     else if (data == "false")
     {
         MessageBox.Show("С таким Логином пользователь уже есть");
     }
 }
Exemple #3
0
 private void IsAvtorization()
 {
     if (File.Exists("./LogIn/LogIn.txt"))
     {
         string[] infoUser = File.ReadAllLines("./LogIn/LogIn.txt");
     }
     else
     {
         System.Windows.Forms.Control form = this;
         SetUI.SetRAControl(new Avtorisation(), null);
     }
 }
        public static void NewRoom(string url)
        {
            GamePanel cGame = null;

            string[] parse = null;
            new Thread(async() =>
            {
                Init();
                string response = await httpClient.GetStringAsync($"http://127.0.0.1:8081/{url}/{NovelManager.login}");
                parse           = response.Split('/');
                cGame           = SwitchControlGame.GetGame(parse[0]);
                SetUI.SetGamePanelControl(cGame, parse[1], parse[2], parse[3]);
            }).Start();
        }
        public static GamePanel GetGame(string nameGame)
        {
            GamePanel pGame = null;

            switch (nameGame)
            {
            case "Tic_tac_toe":
            {
                Tic_tac_toeControl cGame = new Tic_tac_toeControl();
                pGame = SetUI.SetGameOnGamaeOamel(cGame);
                break;
            }
            }
            return(pGame);
        }
        private void Clear()
        {
            Name.Text = string.Empty;

            Language.Items.Clear();
            SetUI.CodeLanguageToCombobox(Language);
            Language.Items.Remove("All");
            Language.SelectedIndex = 0;

            Usage.Document.Blocks.Clear();
            Description.Document.Blocks.Clear();
            Code.Document.Blocks.Clear();

            ControlState.Execute(c, ControlStateVisuals.Background);
        }
Exemple #7
0
        public NavBarSnippet(SnippetsPage page)
        {
            InitializeComponent();
            Page = page;

            SetUI.DatesToCombobox(DateType);
            SetUI.CodeLanguageToCombobox(Language);
            SetUI.TypeToCombobox(SearchType);

            DateType.SelectedIndex   = 0;
            SearchType.SelectedIndex = 0;
            Language.SelectedIndex   = 0;
            startup = true;


            Functionality.Items.Add("Single");
            Functionality.Items.Add("Collection");
            Functionality.SelectedIndex = 0;
        }
Exemple #8
0
        //View-Button-Click
        private void View_Click(object sender, RoutedEventArgs e)
        {
            //Set Code,Usage,Name,Description enz....
            Page.Code.Document.Blocks.Clear();
            Page.Code.Document.Blocks.Add(new Paragraph(new Run(Info._Code)));

            Page.Description.Document.Blocks.Clear();
            Page.Description.Document.Blocks.Add(new Paragraph(new Run(Info._Description)));

            Page.Usage.Document.Blocks.Clear();
            Page.Usage.Document.Blocks.Add(new Paragraph(new Run(Info._UsageExample)));

            Page.Name.Text = Info._Name;
            Page.Language.Items.Clear();
            SetUI.CodeLanguageToCombobox(Page.Language);
            Page.Language.SelectedItem = DbCodeLanguage.ToString(Info._LanguageID);

            Page.ViewMode       = true;
            Page.currentsnippet = Info;
            Page.Nav            = Navbar;
        }
        //Main
        public MainWindow()
        {
            InitializeComponent();
            this.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            UserInfo.SetUserInfo(1);

            Login wd = new Login();

            wd.Show();
            this.Close();



            SetUI.DatesToCombobox(MySnipped_Date_Cmb);
            SetUI.CodeLanguageToCombobox(MySnipped_Languages_Cmb);
            SetUI.TypeToCombobox(MySnipped_Type_Cmb);

            MySnipped_Date_Cmb.SelectedIndex      = 0;
            MySnipped_Type_Cmb.SelectedIndex      = 0;
            MySnipped_Languages_Cmb.SelectedIndex = 0;

            startup = true;
        }
 public static void Disconnect()
 {
     MessageBox.Show("Что то пошло не так, попробуйте зайти поже");
     SetUI.SetRAControl(new Avtorisation(), control);
 }
 private void button1_Click_1(object sender, EventArgs e)
 {
     System.Windows.Forms.Control control = this;
     SetUI.SetRAControl(new Avtorisation(), control);
 }
 private void button2_Click(object sender, EventArgs e)
 {
     System.Windows.Forms.Control control = this;
     SetUI.SetRAControl(new Registration(), control);
 }