Логика взаимодействия для Window1.xaml
Inheritance: System.Windows.Window
示例#1
0
        private void Window_Closed(object sender, EventArgs e)
        {
            MessageBox.Show("关闭主窗口");

            Window1 wis = new Window1();
            wis.Show();

        }
示例#2
0
        public TouchControl(DrawArea owner)
        {
            this.owner = owner;
            nh         = new NodeHandle();

            pub = nh.advertise <Messages.geometry_msgs.Twist>("/cmd_vel", 1, false);

            engineCtlForm  = new WpfApplication1.MainWindow(this);
            directCtrlForm = new WpfApplication1.Window1(this);
        }
示例#3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TaskWindow = ((WpfApplication1.Window1)(target));
                return;

            case 2:
                this.TaskTitleLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.TaskInformation = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#4
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window1 = ((WpfApplication1.Window1)(target));

            #line 8 "..\..\Window1.xaml"
                this.window1.Closing += new System.ComponentModel.CancelEventHandler(this.window1_Closing);

            #line default
            #line hidden
                return;

            case 2:
                this.menu = ((System.Windows.Controls.Menu)(target));
                return;

            case 3:
                this.student = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.s1 = ((System.Windows.Controls.MenuItem)(target));

            #line 12 "..\..\Window1.xaml"
                this.s1.Click += new System.Windows.RoutedEventHandler(this.s1_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.s2 = ((System.Windows.Controls.MenuItem)(target));

            #line 13 "..\..\Window1.xaml"
                this.s2.Click += new System.Windows.RoutedEventHandler(this.s2_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.s3 = ((System.Windows.Controls.MenuItem)(target));

            #line 14 "..\..\Window1.xaml"
                this.s3.Click += new System.Windows.RoutedEventHandler(this.s3_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.courses = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 8:
                this.c1 = ((System.Windows.Controls.MenuItem)(target));

            #line 17 "..\..\Window1.xaml"
                this.c1.Click += new System.Windows.RoutedEventHandler(this.c1_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.c2 = ((System.Windows.Controls.MenuItem)(target));

            #line 18 "..\..\Window1.xaml"
                this.c2.Click += new System.Windows.RoutedEventHandler(this.c2_Click);

            #line default
            #line hidden
                return;

            case 10:
                this.c3 = ((System.Windows.Controls.MenuItem)(target));

            #line 19 "..\..\Window1.xaml"
                this.c3.Click += new System.Windows.RoutedEventHandler(this.c3_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.teacher = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 12:
                this.t1 = ((System.Windows.Controls.MenuItem)(target));

            #line 22 "..\..\Window1.xaml"
                this.t1.Click += new System.Windows.RoutedEventHandler(this.t1_Click);

            #line default
            #line hidden
                return;

            case 13:
                this.add = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 14:
                this.a1 = ((System.Windows.Controls.MenuItem)(target));

            #line 25 "..\..\Window1.xaml"
                this.a1.Click += new System.Windows.RoutedEventHandler(this.a1_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.a2 = ((System.Windows.Controls.MenuItem)(target));

            #line 26 "..\..\Window1.xaml"
                this.a2.Click += new System.Windows.RoutedEventHandler(this.a2_Click);

            #line default
            #line hidden
                return;

            case 16:
                this.a3 = ((System.Windows.Controls.MenuItem)(target));

            #line 27 "..\..\Window1.xaml"
                this.a3.Click += new System.Windows.RoutedEventHandler(this.a3_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
		/**
		 * Pop up the dialog to create a CASettings directly.
		 * Save the values then attempt to load the CA to the clientUI.
		 * We save the state to make it easier to fix errors if they occur.
		 **/
		private void CA_Create(object sender, RoutedEventArgs e) {
			var w1 = new Window1();
			w1.CAName = state.Name;
			w1.NumStates = state.NumStates;
			w1.Neighborhood = state.Neighborhood;
			w1.Delta = state.Delta;
			if (w1.ShowDialog() == true) {
				state.Name = w1.CAName;
				state.NumStates = w1.NumStates;
				state.Neighborhood = w1.Neighborhood.Substring(1,w1.Neighborhood.Length-2);
				state.Delta = w1.Delta.Substring(1, w1.Delta.Length - 2);
				clientui.loadCA(w1.CAName, w1.NumStates, 0, w1.Neighborhood, w1.Delta);
			}
		}
 private void Application_Startup_1(object sender, StartupEventArgs e)
 {
     Window1 window1 = new Window1();
     window1.Show();
 }
 private void salir(object sender, MouseButtonEventArgs e)
 {
     Window1 VentanaInicial = new Window1();
     VentanaInicial.Show();
     this.Close();
 }
示例#8
0
        private void b1_Click(object sender, RoutedEventArgs e)
        {
            Connection c = new Connection();
            c.add();
            String user_name = t1.Text;

            String pass_word = p.Password;

            SqlCommand cmd = new SqlCommand("select user_name,password from login where user_name='" + user_name + "' and password='******' ",c.con);
            SqlDataReader dr;
            dr= cmd.ExecuteReader();
            int count = 0;
            while (dr.Read())
            {
                count += 1;
            }
            dr.Close();
            if (count == 1)
            {
                //MessageBox.Show("Login sucess ");
                SqlCommand cm = new SqlCommand("select emp_id from login where user_name='" + user_name + "' and password='******'",c.con);
                int a = (Int32)cm.ExecuteScalar();
                SqlCommand cm1=new SqlCommand("select ws_name from Workstaion where ws_id='"+a+"'",c.con);
                String works = (String)cm1.ExecuteScalar();
                A.identy = a;
                if (a == 3 || a == 4 || a == 5 || a == 6 || a == 7 || a==1 ||a==2) {
                    Window1 a1 = new Window1();
                    a1.Title = "Log in "+works;
                    a1.Show();
                    this.Hide();
                }

            }
            else
            {
                MessageBox.Show("User Name or Password is Incorrect!");

            }
            c.exit();
        }
示例#9
0
 public TouchControl()
 {
     System.Windows.Forms.Application.EnableVisualStyles();
     engineCtlForm  = new WpfApplication1.MainWindow(this);
     directCtrlForm = new WpfApplication1.Window1(this);
 }
示例#10
0
        private void CommandBinding_Executed_1(object sender, ExecutedRoutedEventArgs e)
        {
            var s = new Window1(this);

            s.ShowDialog();
        }
示例#11
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UnosMani = ((WpfApplication1.Window1)(target));

            #line 7 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.UnosMani.Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing_1);

            #line default
            #line hidden
                return;

            case 2:
                this.idMan = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.nazivMan = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.opisMan = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.tipMan = ((System.Windows.Controls.ComboBox)(target));

            #line 137 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.tipMan.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.tipMan_SelectionChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.dozvoljeno = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 7:
                this.nedozvoljeno = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 8:
                this.cenaMan = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 9:
                this.hendikepiraniMan = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 10:
                this.pusenjeMan = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 11:
                this.napolje = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 12:
                this.unutra = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 13:
                this.datumMan = ((System.Windows.Controls.DatePicker)(target));
                return;

            case 14:
                this.publikeMan = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 15:
                this.TagComboBox = ((System.Windows.Controls.ListBox)(target));
                return;

            case 16:
                this.Show = ((System.Windows.Controls.Button)(target));

            #line 185 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.Show.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.listBox1 = ((System.Windows.Controls.ListBox)(target));
                return;

            case 18:
                this.textBlock1 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 19:
                this.border1 = ((System.Windows.Controls.Border)(target));
                return;

            case 20:
                this.ikonicaMan = ((System.Windows.Controls.Image)(target));
                return;

            case 21:
                this.button1 = ((System.Windows.Controls.Button)(target));

            #line 199 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.button2 = ((System.Windows.Controls.Button)(target));

            #line 200 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click);

            #line default
            #line hidden
                return;

            case 23:
                this.button3 = ((System.Windows.Controls.Button)(target));

            #line 201 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button3.Click += new System.Windows.RoutedEventHandler(this.button3_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.button4 = ((System.Windows.Controls.Button)(target));

            #line 202 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button4.Click += new System.Windows.RoutedEventHandler(this.button4_Click);

            #line default
            #line hidden
                return;

            case 25:
                this.button5 = ((System.Windows.Controls.Button)(target));

            #line 203 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button5.Click += new System.Windows.RoutedEventHandler(this.button5_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.textBlock3 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 27:
                this.textBlock4 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 28:
                this.textBlock5 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 29:
                this.textBlock7 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 30:
                this.textBlock6 = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 31:
                this.autocom = ((System.Windows.Controls.AutoCompleteBox)(target));

            #line 211 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.autocom.Populating += new System.Windows.Controls.PopulatingEventHandler(this.autocom_Populating);

            #line default
            #line hidden

            #line 211 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.autocom.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.autocom_SelectionChanged);

            #line default
            #line hidden
                return;

            case 32:
                this.button6 = ((System.Windows.Controls.Button)(target));

            #line 214 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button6.Click += new System.Windows.RoutedEventHandler(this.button6_Click);

            #line default
            #line hidden
                return;

            case 33:
                this.button7 = ((System.Windows.Controls.Button)(target));

            #line 215 "..\..\..\..\..\Pregled\Unos\UnosManifestacije.xaml"
                this.button7.Click += new System.Windows.RoutedEventHandler(this.button7_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
示例#12
0
        void wbEvents2_NewWindow2(ref object ppDisp, ref bool Cancel)
        {
            Window1 wnd = new Window1();
            wnd.Show();
            wnd.myWebBrowser.Navigate(new Uri("about:blank"));
            //wnd.myWebBrowser.Navigating += new System.Windows.Navigation.NavigatingCancelEventHandler(myWebBrowser_Navigating);

            Guid SID_SWebBrowserApp = new Guid("0002DF05-0000-0000-C000-000000000046");
            IServiceProvider serviceProvider = (IServiceProvider)wnd.myWebBrowser.Document;

            Guid serviceGuid = SID_SWebBrowserApp;

            Guid iid = typeof(SHDocVw.IWebBrowser2).GUID;

            SHDocVw.IWebBrowser2 myWebBrowser2 = (SHDocVw.IWebBrowser2)serviceProvider.QueryService(ref serviceGuid, ref iid);

            ppDisp = myWebBrowser2.Application;

            SHDocVw.DWebBrowserEvents2_Event wbEvents2 = (SHDocVw.DWebBrowserEvents2_Event)myWebBrowser2;
            wbEvents2.NewWindow2 += new SHDocVw.DWebBrowserEvents2_NewWindow2EventHandler(wbEvents2_NewWindow2);
            wbEvents2.NavigateError += new SHDocVw.DWebBrowserEvents2_NavigateErrorEventHandler(wbEvents2_NavigateError);
            wbEvents2.RedirectXDomainBlocked += new SHDocVw.DWebBrowserEvents2_RedirectXDomainBlockedEventHandler(wbEvents2_RedirectXDomainBlocked);
            wbEvents2.ThirdPartyUrlBlocked += new SHDocVw.DWebBrowserEvents2_ThirdPartyUrlBlockedEventHandler(wbEvents2_ThirdPartyUrlBlocked);
        }
示例#13
0
 private void BT_NextWindow_Click(object sender, RoutedEventArgs e)
 {
     Window1 win1 = new Window1();
     win1.Show();
     this.Close();
 }
示例#14
0
        private void videoget()
        {
            string link;
            IEnumerable <VideoInfo> videoInfos;

            try
            {
                link       = youtlink.Text;
                videoInfos = DownloadUrlResolver.GetDownloadUrls(link);
            }
            catch
            {
                Error1 e1 = new Error1();
                e1.ShowDialog();
                return;
            }
            quality q1 = new quality();

            id_prog.Visibility = System.Windows.Visibility.Visible;
            q1.ShowDialog();
            qual = q1.quali;

            VideoInfo video;// = videoInfos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);

            try
            {
                video = videoInfos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == qual);
            }
            catch
            {
                tb3.Text = "Unavailable";
                video    = videoInfos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);
            }
            id_prog.Visibility = System.Windows.Visibility.Hidden;
            tb3.Text           = video.Resolution.ToString();
            fileName           = Locat.Text + video.Title + ".mp4"; //System.IO.Path.GetFileName(url1.LocalPath);
            _source            = video.DownloadUrl;
            _destination       = fileName;
            percl = GetContentLength();
            if (!File.Exists(_destination))
            {
                Start();
            }
            else
            {
                Window1 Win = new Window1();
                Win.ShowDialog();

                if (Win.check == 1)
                {
                    abc.Text = "File to be overwritten";
                    File.Delete(_destination);
                    Start();
                    abc.Text = "Done ";
                }
                else
                {
                    abc.Text = "Operation Aborted";
                }
            }
        }
示例#15
0
 /// <summary>
 /// The default constructor that calls the registration window
 /// </summary>
 public MainWindow()
 {
     InitializeComponent();
     try
     {
         StreamReader sr = new StreamReader("setting_server.txt");
         ip_adres_serser = sr.ReadLine().Remove(0, 11);
         Window1 w1 = new Window1();
         w1.ShowDialog();
         LogPass lp = new LogPass();
         lp.ShowDialog();
         if (close == false)
         {
             this.Close();
         }
         else
         {
             lable1.Content = name_user + " " + surname_user;
             MessageBox.Show(string.Format("Добро пожаловать {0} {1} ", name_user, surname_user));
             ShowMessage();
             TabController.SelectedIndex = 0;
             TabController.SelectedItem  = Message;
             this.MyId.Content           = "Мой Id: " + MainWindow.id_user;
         }
     }
     catch (FileNotFoundException)
     {
         FileStream fs = new FileStream("seting_server.txt", FileMode.OpenOrCreate);
         byte[]     buf_seting_file = new byte[4096];
         buf_seting_file = Encoding.Unicode.GetBytes("ip server: 192.168.2.103");
         fs.Write(buf_seting_file, 0, buf_seting_file.Length);
         ip_adres_serser = "192.168.2.103";
         Window1 w1 = new Window1();
         w1.ShowDialog();
         LogPass lp = new LogPass();
         lp.ShowDialog();
         if (close == false)
         {
             this.Close();
         }
         else
         {
             lable1.Content = name_user + " " + surname_user;
             MessageBox.Show(string.Format("Добро пожаловать {0} {1} ", name_user, surname_user));
             ShowMessage();
             TabController.SelectedIndex = 0;
             TabController.SelectedItem  = Message;
             this.MyId.Content           = "Мой Id: " + MainWindow.id_user;
         }
     }
     catch (DirectoryNotFoundException)
     {
         FileStream fs = new FileStream("seting_server.txt", FileMode.OpenOrCreate);
         byte[]     buf_seting_file = new byte[4096];
         buf_seting_file = Encoding.Unicode.GetBytes("ip server: 192.168.2.103");
         fs.Write(buf_seting_file, 0, buf_seting_file.Length);
         ip_adres_serser = "192.168.2.103";
         Window1 w1 = new Window1();
         w1.ShowDialog();
         LogPass lp = new LogPass();
         lp.ShowDialog();
         if (close == false)
         {
             this.Close();
         }
         else
         {
             lable1.Content = name_user + " " + surname_user;
             MessageBox.Show(string.Format("Добро пожаловать {0} {1} ", name_user, surname_user));
             ShowMessage();
             TabController.SelectedIndex = 0;
             TabController.SelectedItem  = Message;
             this.MyId.Content           = "Мой Id: " + MainWindow.id_user;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         this.Close();
     }
 }
示例#16
0
        private void Insert_Compounds(object sender, RoutedEventArgs e)
        {
            Window1 win1 = new Window1();

            win1.Show();
        }