public MainForm () { SuspendLayout (); // // _userControl // _userControl = new UserControl1 (); _userControl.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right); _userControl.BackColor = Color.White; _userControl.Location = new Point (8, 8); _userControl.Size = new Size (288, 238); _userControl.TabIndex = 0; Controls.Add (_userControl); // // _statusBar // _statusBar = new StatusBar (); Controls.Add (_statusBar); // // MainForm // ClientSize = new Size (304, 280); Location = new Point (250, 100); StartPosition = FormStartPosition.Manual; Text = "bug #81695"; Load += new EventHandler (MainForm_Load); ResumeLayout (false); }
public void Form1_Load(object sender, EventArgs e) { // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet3.info_registration". При необходимости она может быть перемещена или удалена. this.info_registrationTableAdapter.Fill(this.electronOcheredDataSet3.info_registration); try { UserControl1 US = new UserControl1(); string con_str = US.Con_str(); if (con_str != "error" && con_str != "") { Properties.Settings.Default["EOConnectionString"] = con_str; Properties.Settings.Default.Save(); } // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet.seriya_svidet". При необходимости она может быть перемещена или удалена. this.seriya_svidetTableAdapter.Fill(this.electronOcheredDataSet.seriya_svidet); // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet2.info_registration". При необходимости она может быть перемещена или удалена. this.info_registrationTableAdapter.Fill(this.electronOcheredDataSet.info_registration); // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet.info_predstavitel". При необходимости она может быть перемещена или удалена. this.info_predstavitelTableAdapter.Fill(this.electronOcheredDataSet.info_predstavitel); // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet.info_rebenok". При необходимости она может быть перемещена или удалена. this.info_rebenokTableAdapter.Fill(this.electronOcheredDataSet.info_rebenok); // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet.ou". При необходимости она может быть перемещена или удалена. this.ouTableAdapter.Fill(this.electronOcheredDataSet.ou); // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet1.lgot". При необходимости она может быть перемещена или удалена. this.lgotTableAdapter.Fill(this.electronOcheredDataSet1.lgot); // TODO: данная строка кода позволяет загрузить данные в таблицу "electronOcheredDataSet.Table_ochered". При необходимости она может быть перемещена или удалена. this.table_ocheredTableAdapter.Fill(this.electronOcheredDataSet.Table_ochered); // tableocheredBindingSource.Sort = "znachenie_lgot ASC, data_reg ASC"; toolStripComboBox1.Items.Clear(); toolStripComboBox1.Items.Add("Все"); toolStripComboBox1.SelectedIndex = 0; DataTable dt_ou = ouTableAdapter.GetData(); for (int i = 0; i < dt_ou.Rows.Count; i++) { toolStripComboBox1.Items.Add(dt_ou.Rows[i]["name_ou"].ToString()); } comboBox2.SelectedIndex = -1; comboBox3.SelectedIndex = -1; UpdateNum(); if (textBox_kod_info.Text.Length == 0) { toolStripButton2.Enabled = false; } else { toolStripButton2.Enabled = true; } } catch (Exception ex) { of.ErrorInfoToFile(ex); } }
public FormExpense() { InitializeComponent(); //todo: obviamente isso é só um exemplo //todo: edição de um item específico do grid do excel _wpfControl = new UserControl1(); this.elementHost1.Child = _wpfControl; _wpfControl.Save += WpfControlSave; _wpfControl.Next += WpfControlNext; _wpfControl.Previous += WpfControlPrevious; this.Closing += FormSaidaClosing; _controller = NinjectContainer.Kernel.Get<BaseController<Expense>>(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.userControl11 = new WindowsFormsApplication1.UserControl1(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // linkLabel1 // this.linkLabel1.Location = new System.Drawing.Point(33, 67); this.linkLabel1.Name = "linkLabel1"; this.linkLabel1.Size = new System.Drawing.Size(217, 43); this.linkLabel1.TabIndex = 2; this.linkLabel1.TabStop = true; this.linkLabel1.Text = "This is an example how to route events from User Form to parent form"; this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); // // userControl11 // this.userControl11.Location = new System.Drawing.Point(24, 22); this.userControl11.Name = "userControl11"; this.userControl11.Size = new System.Drawing.Size(234, 197); this.userControl11.TabIndex = 0; // // label1 // this.label1.Location = new System.Drawing.Point(43, 176); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(197, 35); this.label1.TabIndex = 3; this.label1.Text = "You can drag an instance of the User Control from the toolbox"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(282, 266); this.Controls.Add(this.label1); this.Controls.Add(this.linkLabel1); this.Controls.Add(this.userControl11); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); }
protected void Button2_Click(object sender, EventArgs e) { string password = TextBox1.Text; int userid = Convert.ToInt32(Session["UserId"]); //修改密码 if (password != "" && password == TextBox2.Text) { UserControl1 uc = new UserControl1(); uc.ChangePassword(userid, password); Panel1.Visible = false; LinkButton1.Visible = true; Label7.Text = ""; } else { Label7.Text = "两次密码不相同!"; } }
// http://www.samsung.com/us/support/owners/product/GT-I9250TSGGEN protected override void onCreate(Bundle savedInstanceState) { ScriptCoreLib.Android.ThreadLocalContextReference.CurrentContext = this; base.onCreate(savedInstanceState); // USB tether // SAMSUNG Android USB Remote NDIS Network Device ((WifiManager)this.getSystemService(Context.WIFI_SERVICE)).createWifiLock( WifiManager.WIFI_MODE_FULL_HIGH_PERF, "InteractivePortForwarding" ).acquire(); var r = default(global::ScriptCoreLib.Android.Windows.Forms.IAssemblyReferenceToken_Forms); var u = new UserControl1(); u.AttachTo(this); }
public void dragImg() { flowLayoutPanel1.Controls.Clear(); UserControl1 uc = null; VerifyEntity ve = null; startIndex = (pageIndex - 1) * pageCount; endIndex = pageIndex * pageCount; endIndex = endIndex > libArr.Count ? libArr.Count : endIndex; for (int i = startIndex; i < endIndex; i++) { ve = (VerifyEntity)libArr[i]; uc = new UserControl1(); uc.SetText(ve.Code); uc.SetPic(ConfigStore.appDir + ve.ImgPath); uc.SetAttr1(ve.Data); flowLayoutPanel1.Controls.Add(uc); } label3.Text = "当前第" + pageIndex + "/" + allIndex + "页。共" + libArr.Count + "条记录"; if (allIndex > 1 && pageIndex < allIndex) { btn_next.Enabled = true; } else { btn_next.Enabled = false; } if (pageIndex > 1) { btn_per.Enabled = true; button1.Enabled = true; } else { btn_per.Enabled = false; button1.Enabled = false; } }
private void Form1_Shown(object sender, EventArgs e) { usr = new UserControl1(); usr.Dock = DockStyle.Fill; panel1.Controls.Add(usr); }
private void Form1_Load(object sender, EventArgs e) { UpdateStatistic(); sentenceControl = new UserControl1(new Model.Sentense(dane), dane, this); mainPanel.Controls.Add(sentenceControl); }
private void UserControlLoaded(UserControl1 control) { // The user control should be set here for easy accessibility // This leaves the UIElement variable alone to be dealt with by the DeskBand parent functionality deskbandControl = control; // Provide the function in this class that performs the device enable/disable action deskbandControl.SetEnabledDisabledDeviceFunction(EnableDisableDevice); // Provide the function to show the settings window deskbandControl.SetShowSettingsWindowFunction(ShowSettingsWindow); // Initialise the connection to the Windows service if (InitialiseServiceConnection(false)) { // Get the selected touch screen device hardware ID try { string deviceHardwareId = TTService.GetSelectedHardwareID(); if (deviceHardwareId == null) { // If no ID is specified, show the settings window ShowSettingsWindow(); } } catch (CommunicationException) { // Do nothing } } // Set up the watcher for hardware changes WqlEventQuery query = new WqlEventQuery("SELECT * FROM Win32_DeviceChangeEvent"); ManagementEventWatcher watcher = new ManagementEventWatcher(query); watcher.EventArrived += new EventArrivedEventHandler(HardwareChangeEvent); watcher.Start(); // Set the serivce connection ticker event serviceConnectionTicker.Elapsed += (object source, System.Timers.ElapsedEventArgs e2) => { if (TTService != null) { // If a connection exists try { // Test the connection TTService.TestServiceConnection(); } catch (CommunicationException) { // Retry the connection ServiceCommunicationFailure(false); } } else { // Attempt to make a connection InitialiseServiceConnection(allowUserAdminActionInput: false); } }; }
private void Button_Click(object sender, RoutedEventArgs e) { _control = new UserControl1(); _control.OnExit += _control_OnExit; // Subscribe to event so you can remove the child when it exits _content.Content = _control; // _content is a ContentControl defined in Window.xaml }
/// <summary> /// 双击通道打开视频 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ChannelManageListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e) { try { ChannelListItemViewModel lbi = (sender as ListBox).SelectedItem as ChannelListItemViewModel; if (lbi == null) { return; } string ip = lbi.MyChannelCfg.CaptureCfg.TcAddr; if (ip == string.Empty) { System.Windows.MessageBox.Show("摄像机IP为空!"); return; } if (true) { if (lbi.IsOpened == false) { lbi.IsOpened = true; currentVideo++; UserControl1 usercontrol = new UserControl1(); usercontrol.opencamera(lbi.MyChannelCfg.CaptureCfg.NCaptureType, lbi.MyChannelCfg.CaptureCfg.TcAddr + "|" + lbi.MyChannelCfg.TcDescription, (uint)lbi.MyChannelCfg.CaptureCfg.NPort, lbi.MyChannelCfg.CaptureCfg.TcUID, lbi.MyChannelCfg.CaptureCfg.TcPSW, 1, 1); foreach (WindowsFormsHost wfh in wFHList) { if (wfh.Tag == null) { wfh.Child = usercontrol; wfh.Tag = lbi.MyChannelCfg.TcChaneelID; break; } } if (currentVideo > currentMaxvideo) { SetVideoGridScreen(currentVideo); } this.UpdateLayout(); } else { currentVideo--; foreach (WindowsFormsHost wfh in wFHList) { if (wfh.Tag != null && wfh.Tag.ToString() == lbi.MyChannelCfg.TcChaneelID) { (wfh.Child as UserControl1).closecamera(); wfh.Child = null; wfh.Tag = null; break; } } lbi.IsOpened = false; } } else { System.Windows.MessageBox.Show("摄像机无法连接!"); } } catch (Exception ex) { _WriteLog.WriteToLog("ChannelManageListBox_MouseDoubleClick", ex); MessageBox.Show(ex.Message); } }
private void BDraw_Click(object sender, RoutedEventArgs e) { canvas.Children.Clear(); DiagramHeight1 = 0; count = 0; #region name=variebles; //---------Количество рейсов l.Content = ""; l2.Content = ""; l1.Content = ""; l3.Content = ""; l4.Content = ""; l5.Content = ""; l6.Content = ""; l7.Content = ""; l8.Content = ""; l9.Content = ""; l10.Content = ""; l11.Content = ""; //-------------------- //-------Подписи месяцев m.Content = ""; m1.Content = ""; m2.Content = ""; m3.Content = ""; m4.Content = ""; m5.Content = ""; m6.Content = ""; m7.Content = ""; m8.Content = ""; m9.Content = ""; m10.Content = ""; m11.Content = ""; ///////////////////// MonthTitle.Content = ""; /////////////////////// RaceTitle.Content = ""; /////////////////////// //---------------------- //обнуление флагов flag1 = false; flag2 = false; flag3 = false; flag4 = false; flag5 = false; flag6 = false; flag7 = false; flag8 = false; flag9 = false; flag10 = false; flag11 = false; flag12 = false; //----------------- place = 150; #endregion if (cbYear.SelectedItem == null) { MessageBox.Show("Укажите год!", "Внимание!", MessageBoxButton.OK, MessageBoxImage.Exclamation); } else { string date1 = "01/01/" + (string)cbYear.SelectedItem; DateTime dt1 = DateTime.ParseExact(date1, "dd/MM/yyyy", null); string date2; DateTime dt2; Model1 context1 = new Model1(); var r = context1.Заказы; #region name=months //первый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 1) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag1 = true; } } } } if (flag1) { fill = new SolidColorBrush(Colors.Red); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); m.Content = "1"; string CountId = String.Format("" + count); if (count != 0) { l.Content = CountId; Canvas.SetLeft(l, place - 30); Canvas.SetTop(l, 320 - DiagramHeight1 - 20); canvas.Children.Add(l); } canvas.Children.Add(uc1); Canvas.SetLeft(m, place - 35); Canvas.SetTop(m, 320); canvas.Children.Add(m); count = 0; DiagramHeight1 = 0; //place = 50; } //второй месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 2) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag2 = true; } } } } if (flag2) { fill = new SolidColorBrush(Colors.Blue); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string Month = "2"; m1.Content = Month; string CountId = String.Format("" + count); if (count != 0) { l1.Content = CountId; Canvas.SetLeft(l1, place - 30); Canvas.SetTop(l1, 320 - DiagramHeight1 - 20); canvas.Children.Add(l1); } canvas.Children.Add(uc1); Canvas.SetLeft(m1, place - 35); Canvas.SetTop(m1, 320); canvas.Children.Add(m1); count = 0; DiagramHeight1 = 0; place = 150; } //третий месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 3) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag3 = true; } } } } if (flag3) { fill = new SolidColorBrush(Colors.Green); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } string Month = "3"; m2.Content = Month; Canvas.SetLeft(m2, place - 35); Canvas.SetTop(m2, 320); canvas.Children.Add(m2); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l2.Content = CountId; Canvas.SetLeft(l2, place - 30); Canvas.SetTop(l2, 320 - DiagramHeight1 - 20); canvas.Children.Add(l2); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //четвертый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 4) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag4 = true; } } } } if (flag4) { fill = new SolidColorBrush(Colors.Yellow); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } m3.Content = "4"; Canvas.SetLeft(m3, place - 35); Canvas.SetTop(m3, 320); canvas.Children.Add(m3); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l3.Content = CountId; Canvas.SetLeft(l3, place - 30); Canvas.SetTop(l3, 320 - DiagramHeight1 - 20); canvas.Children.Add(l3); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //пятый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 5) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag5 = true; } } } } if (flag5) { fill = new SolidColorBrush(Colors.Purple); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } m4.Content = "5"; Canvas.SetLeft(m4, place - 35); Canvas.SetTop(m4, 320); canvas.Children.Add(m4); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l4.Content = CountId; Canvas.SetLeft(l4, place - 30); Canvas.SetTop(l4, 320 - DiagramHeight1 - 20); canvas.Children.Add(l4); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //шестой месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 6) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag6 = true; } } } } if (flag6) { fill = new SolidColorBrush(Colors.RosyBrown); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } m5.Content = "6"; Canvas.SetLeft(m5, place - 35); Canvas.SetTop(m5, 320); canvas.Children.Add(m5); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l5.Content = CountId; Canvas.SetLeft(l5, place - 30); Canvas.SetTop(l5, 320 - DiagramHeight1 - 20); canvas.Children.Add(l5); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //седьмой месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 7) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag7 = true; } } } } if (flag7) { fill = new SolidColorBrush(Colors.Pink); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } if (flag6) { place += 50; } m6.Content = "7"; Canvas.SetLeft(m6, place - 35); Canvas.SetTop(m6, 320); canvas.Children.Add(m6); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l6.Content = CountId; Canvas.SetLeft(l6, place - 30); Canvas.SetTop(l6, 320 - DiagramHeight1 - 20); canvas.Children.Add(l6); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //восьмой месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 8) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag8 = true; } } } } if (flag8) { fill = new SolidColorBrush(Colors.DarkGreen); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } if (flag6) { place += 50; } if (flag7) { place += 50; } m7.Content = "8"; Canvas.SetLeft(m7, place - 35); Canvas.SetTop(m7, 320); canvas.Children.Add(m7); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l7.Content = CountId; Canvas.SetLeft(l7, place - 30); Canvas.SetTop(l7, 320 - DiagramHeight1 - 20); canvas.Children.Add(l7); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //девятый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 9) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag9 = true; } } } } if (flag9) { fill = new SolidColorBrush(Colors.Azure); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } if (flag6) { place += 50; } if (flag7) { place += 50; } if (flag8) { place += 50; } m8.Content = "9"; Canvas.SetLeft(m8, place - 35); Canvas.SetTop(m8, 320); canvas.Children.Add(m8); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l8.Content = CountId; Canvas.SetLeft(l8, place - 30); Canvas.SetTop(l8, 320 - DiagramHeight1 - 20); canvas.Children.Add(l8); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //десятый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 10) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag10 = true; } } } } if (flag10) { fill = new SolidColorBrush(Colors.PeachPuff); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } if (flag6) { place += 50; } if (flag7) { place += 50; } if (flag8) { place += 50; } if (flag9) { place += 50; } m9.Content = "10"; Canvas.SetLeft(m9, place - 35); Canvas.SetTop(m9, 320); canvas.Children.Add(m9); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l9.Content = CountId; Canvas.SetLeft(l9, place - 30); Canvas.SetTop(l9, 320 - DiagramHeight1 - 20); canvas.Children.Add(l9); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //одинадцатый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 11) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag11 = true; } } } } if (flag11) { fill = new SolidColorBrush(Colors.SeaGreen); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } if (flag6) { place += 50; } if (flag7) { place += 50; } if (flag8) { place += 50; } if (flag9) { place += 50; } if (flag10) { place += 50; } m10.Content = "11"; Canvas.SetLeft(m10, place - 35); Canvas.SetTop(m10, 320); canvas.Children.Add(m10); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l10.Content = CountId; Canvas.SetLeft(l10, place - 30); Canvas.SetTop(l10, 320 - DiagramHeight1 - 20); canvas.Children.Add(l10); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } //двенадцатый месяц foreach (Заказы i in r) { if (i.ДатаДоставки != null) { date2 = "01/01/" + i.ДатаДоставки.Value.Year.ToString(); dt2 = DateTime.ParseExact(date2, "dd/MM/yyyy", null); int cmp = dt1.CompareTo(dt2); if (cmp == 0) { if (i.ДатаДоставки.Value.Month == 12) { DiagramHeight1 = DiagramHeight1 + (1 * 30); count++; flag12 = true; } } } } if (flag12) { fill = new SolidColorBrush(Colors.DarkMagenta); if (DiagramHeight1 > 240) { DiagramHeight1 = 240; } uc1 = new UserControl1() { WHeight = DiagramHeight1, WFill = fill }; if (flag1) { place += 50; } if (flag2) { place += 50; } if (flag3) { place += 50; } if (flag4) { place += 50; } if (flag5) { place += 50; } if (flag6) { place += 50; } if (flag7) { place += 50; } if (flag8) { place += 50; } if (flag9) { place += 50; } if (flag10) { place += 50; } if (flag11) { place += 50; } m11.Content = "12"; Canvas.SetLeft(m11, place - 35); Canvas.SetTop(m11, 320); canvas.Children.Add(m11); Canvas.SetLeft(uc1, place); Canvas.SetTop(uc1, 320); uc1.RenderTransform = new RotateTransform(180); string CountId = String.Format("" + count); if (count != 0) { l11.Content = CountId; Canvas.SetLeft(l11, place - 30); Canvas.SetTop(l11, 320 - DiagramHeight1 - 20); canvas.Children.Add(l11); } canvas.Children.Add(uc1); count = 0; DiagramHeight1 = 0; place = 150; } #endregion //-------Вывод надписи месяц:------- if (flag1 || flag2 || flag3 || flag4 || flag5 || flag6 || flag7 || flag8 || flag9 || flag10 || flag11 || flag12) { MonthTitle.Content = "Месяцы"; MonthTitle.Background = new SolidColorBrush(Colors.SeaShell); Canvas.SetTop(MonthTitle, 380); Canvas.SetLeft(MonthTitle, 200); canvas.Children.Add(MonthTitle); RaceTitle.Content = "Количество\nрейсов"; RaceTitle.Background = new SolidColorBrush(Colors.SeaShell); Canvas.SetTop(RaceTitle, 200); Canvas.SetLeft(RaceTitle, 0); canvas.Children.Add(RaceTitle); } //----------------------------------- } }
private MenuItem CreateDirectoryNodeForLocal(object direct) { ClassAboutFilesAdding directoryInfo = (ClassAboutFilesAdding)direct; string ip_sender = ""; if (directoryInfo.Sender == "Этот компьютер") { ip_sender = "127.0.0.1"; } else { ip_sender = directoryInfo.Sender; } var ans = GetDirectoryLocal(directoryInfo.RootLocationFilesOrDirectory + directoryInfo.nameFile); if (ans != "False") { var files = ans.Split('\n'); files[files.Length - 1] = null; object papka_ = null; System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action( () => { WpfControlLibrary3.UserControl1 papka = new WpfControlLibrary3.UserControl1(); papka.Ip_From = directoryInfo.Sender; papka.Ip_To = directoryInfo.Receiver; papka.Path_From = directoryInfo.RootLocationFilesOrDirectory + directoryInfo.nameFile; papka.Path_To = directoryInfo.RemoteLocationFilesOrDirectory + directoryInfo.nameFile; papka.IsHeightValue = files.Length - 1; if (sbros != null) { WpfControlLibrary3.UserControl1 tyc = (WpfControlLibrary3.UserControl1)sbros; papka.OnCompleteTransmit += tyc.ChangedvalueForProgressBar; } papka_ = papka; })); var directoryNode = new MenuItem() { Title = directoryInfo.nameFile, flk = papka_ }; //создаем фалй или папку, пока что мы не знаем foreach (var file in files) { if (file != null) { string name = ""; List <(string, string, string)> ps = CuttingMessages(file); if (ps[0].Item3 == "-1") { name = ps[0].Item1 + "\\"; } else { name = ps[0].Item1; } ClassAboutFilesAdding files1 = new ClassAboutFilesAdding() // создаём экземпляр класса { nameFile = ps[0].Item1, // указываем имя файла time = ps[0].Item2, // указываем время создания sizeFile = ps[0].Item3, // указываем размер LocalParentPath = directoryInfo.RootLocationFilesOrDirectory, LocalParentName = directoryInfo.nameFile, RootLocationFilesOrDirectory = directoryInfo.RootLocationFilesOrDirectory + directoryInfo.nameFile + "\\", Receiver = directoryInfo.Receiver, Sender = directoryInfo.Sender, RemoteLocationFilesOrDirectory = directoryInfo.RemoteLocationFilesOrDirectory + directoryInfo.nameFile + "\\", RemoteParentName = directoryInfo.nameFile, RemoteParentPath = directoryInfo.RemoteLocationFilesOrDirectory }; if (ps[0].Item3 == "" || ps[0].Item3 == "-1") { sbros = directoryNode.flk; directoryNode.Items.Add(CreateDirectoryNodeForLocal(files1)); } else { System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Normal, new Action( () => { UserControl1 flk = new UserControl1(); flk.Ip_From = files1.Sender; flk.Ip_To = files1.Receiver; flk.Path_From = files1.RootLocationFilesOrDirectory; flk.Path_To = files1.RemoteLocationFilesOrDirectory; WpfControlLibrary3.UserControl1 _papka = (WpfControlLibrary3.UserControl1)directoryNode.flk; flk.OnCompleteTransmit += _papka.ChangedvalueForProgressBar; if (files1.Sender != "Этот компьютер") // Если отправитель удаленный пк { var client = new TcpFileClient(files1.Sender); //Подписываемся на события client.SendingEvent += flk.ChangedvalueForProgressBar; client.FailEvent += flk.SendingFailMessage; client.ReadyEvent += flk.SendingSuccessfullyMessage; string path = flk.Path_To + files1.nameFile + "|" + flk.Path_From + files1.nameFile; client.SendFileRequest(path); //Thread receiveThread = new Thread(new ParameterizedThreadStart(client.SendFileRequest)); //receiveThread.IsBackground = true; //receiveThread.Start(path); } else // если отправитель текущий пк { var client = new TcpFileClient(files1.Receiver); //Подписываемся на события client.SendingEvent += flk.ChangedvalueForProgressBar; client.FailEvent += flk.SendingFailMessage; client.ReadyEvent += flk.SendingSuccessfullyMessage; string path = flk.Path_To + files1.nameFile + "|" + flk.Path_From + files1.nameFile; client.SendFileRequest(path); } directoryNode.Items.Add(new MenuItem() { Title = ps[0].Item1, flk = flk }); })); } } } return(directoryNode); } else { return(null); } }
public LocalPLC24P(SplitContainer splitContainer, UserControlBase userBase , DataManageBase dataManage) { try { //控制器类型 this.Tag = 0; InitializeComponent(); split = splitContainer; userBase_ = userBase; UserControl1 us1 = (UserControl1)userBase.parent_; myDelegate = new DoSomethingEventHandler(us1.DoSomething); di = new UserControlDI(us1); dout = new UserControlDO(/*null, */ us1); hi = new UserControlHighIn(us1); hout = new UserControlHighOutput(us1); // Create the ToolTip and associate with the Form container. ToolTip toolTip1 = new ToolTip(); // Set up the delays for the ToolTip. toolTip1.AutoPopDelay = 5000; toolTip1.InitialDelay = 500; toolTip1.ReshowDelay = 200; // Force the ToolTip text to be displayed whether or not the form is active. toolTip1.ShowAlways = true; //pictureBox2.Parent = pictureBox1; //pictureBox3.Parent = pictureBox1; pictest1.Parent = pictureBox1; toolTip1.SetToolTip(pictest1, "DO"); pictest2.Parent = pictureBox1; toolTip1.SetToolTip(pictest2, "DI"); Serial_Line_1.Parent = pictureBox1; Serial_Line_1.Tag = "COM1"; // Set up the ToolTip text for the Button and Checkbox. toolTip1.SetToolTip(this.Serial_Line_1, Serial_Line_1.Tag.ToString()); Ethernet_1.Parent = pictureBox1; Ethernet_1.Tag = "NET1"; toolTip1.SetToolTip(Ethernet_1, Ethernet_1.Tag.ToString()); Serial_Line_2.Parent = pictureBox1; Serial_Line_2.Tag = "COM2"; toolTip1.SetToolTip(this.Serial_Line_2, Serial_Line_2.Tag.ToString()); //key value //com1 comobject 从配置文件读 picArray.Add("COM1", Serial_Line_1); picArray.Add("COM2", Serial_Line_2); picArray.Add("NET1", Ethernet_1); picArray.Add("DO", pictest1); picArray.Add("DI", pictest2); if (!dataManage.newControlerFlag) { refreshData(); } else { initDIDO(); } } catch { } }
private void button1_Click(object sender, EventArgs e) { UserControl1 userControl = new UserControl1(); this.flowLayoutPanel1.Controls.Add(userControl); }
private void remove(UserControl1 UC, int index) { UC.Controls.Remove(UC.arrControls[index]); UC.arrControls[index] = null; }
private void add(UserControl1 UC, int index, Control C, int width_of_control) { UC.arrControls[index] = C; UC.Controls.Add(C); UC.arrControls[index].Location = new Point(width_of_control, 3); }
public void CheckButtonStatus(UserControl1 btn, Button btnVal) //, Button btnVal { if (opc.Connect(txtNode.Text, cmbServerList.Text)) { btnListRefresh.Enabled = false; btnDisconnect.Enabled = true; btnConnect.Enabled = false; string[] target = new string[2]; // string[] target = new string[]; for (int l = 0; l < btn.BtnUcs.Length; l++) { target[0] = btn.AmAddrTextbox; target[1] = btn.OpAddrTextbox; object[] val; int[] nErrorArray; short[] wQualityArray; OpcRcw.Da.FILETIME[] fTimeArray; if (opc.Read(target, out val, out wQualityArray, out fTimeArray, out nErrorArray) == true) { string regValue; regValue = ReadValCopy(val[1], 0, nErrorArray[0]); if (btnVal == btn.OpButton) { if (regValue == "0") { btn.OPStatTextbox = "None"; } else if (regValue == "1") { btn.OPStatTextbox = "Prohibition"; } else if (regValue == "2") { btn.OPStatTextbox = "Maintenance"; } else if (regValue == "3") { btn.OPStatTextbox = "Broke"; } else { return; } } else { if (regValue == "True" || regValue == "-1") { btnVal.Text = "On"; } else if (regValue == "False" || regValue == "0") { btnVal.Text = "Off"; } } } } ; //ButtonUserControl.UserControl1 parent = new ButtonUserControl.UserControl1(opc); //parent.ButtonEvent(opc); } }
private void load_home() { //reset post_Q & map& flpn_home this.post_Q.Clear(); this.map.Clear(); flpn_home.Controls.Clear(); //set request packet to server this.post = new Post(); this.post.Type = (int)PacketType.post; this.post.purpose = 2; //send request packet to server Packet.Serialize(this.post).CopyTo(w_buffer, 0); this.send(); Thread.Sleep(5000); //receive packet until end while (this.stream.DataAvailable) { //receive result packet from server //if error occur during prepare stream & r_buffer if (!preparing_receive()) { return; } Packet packet = (Packet)Packet.Deserialize(this.r_buffer); switch (packet.Type) { //if receive Member packet case (int)PacketType.member: { this.member = (Member)Packet.Deserialize(this.r_buffer); if (this.member.purpose == 5) { try { map.Add(this.member.ID, new ImageConverter().ConvertFrom(this.member.profile_pic) as Image); } catch (ArgumentException e) { MessageBox.Show(string.Format("duplicate id when input data map... id : {0}", this.member.ID)); } } } break; //if receive Post packet case (int)PacketType.post: { this.post = (Post)Packet.Deserialize(this.r_buffer); if (this.post.purpose == 2) { this.post_Q.Enqueue(this.post); } } break; } } //add post at flpn_home foreach (Post p in post_Q) { //alloc new post panel and set data UserControl1 tmp = new UserControl1(); tmp.SetProfile(map[p.ID]); tmp.SetId(p.ID); tmp.SetPic(new ImageConverter().ConvertFrom(p.picture) as Image); tmp.SetComment(p.comment); tmp.SetTime(new DateTimeConverter().ConvertToString(p.time)); //add flpn_post flpn_home.Controls.Add(tmp); } }
private void Form1_Load(object sender, EventArgs e) { UserControl1 uc = new UserControl1(); flowLayoutPanel1.Controls.Add(uc); }
public async void _calculatingPathForTransmitting(object obj, TcpServer tcpServer) { ClassAboutFilesAdding[] filesForTransmit = (ClassAboutFilesAdding[])obj; for (int i = 0; i < filesForTransmit.Length; i++) { // Если отправитель текущий пк if (filesForTransmit[i].Sender == "Этот компьютер") { // Если это файл if (filesForTransmit[i].sizeFile != "") { System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Render, new Action( () => { UserControl1 flk = new UserControl1(); flk.Name_ = filesForTransmit[i].nameFile; flk.Ip_From = filesForTransmit[i].Sender; flk.Ip_To = filesForTransmit[i].Receiver; flk.Path_From = filesForTransmit[i].RootLocationFilesOrDirectory; flk.Path_To = filesForTransmit[i].RemoteLocationFilesOrDirectory; window.tiktak.Items.Add(new MenuItem() { Title = filesForTransmit[i].nameFile, flk = flk }); var client = new TcpFileClient(filesForTransmit[i].Receiver); //Подписываемся на события client.SendingEvent += flk.ChangedvalueForProgressBar; client.FailEvent += flk.SendingFailMessage; client.ReadyEvent += flk.SendingSuccessfullyMessage; ////var ans = RequestInteractivity.SendRequst(ip_to, RequestTipe.GetFileFromMe, flk.Path_To + "|" + flk.Path_From); string path = flk.Path_To + filesForTransmit[i].nameFile + "|" + flk.Path_From + filesForTransmit[i].nameFile; client.SendFileRequestFromMe(path); // Запуск асинхронного метода //var client = new TcpFileClient(filesForTransmit[i].Receiver); //Подписываемся на события //client.SendingEvent += flk.ChangedvalueForProgressBar; //client.FailEvent += flk.SendingFailMessage; //client.ReadyEvent += flk.SendingSuccessfullyMessage; ////var ans = RequestInteractivity.SendRequst(ip_to, RequestTipe.GetFileFromMe, flk.Path_To + "|" + flk.Path_From); //string path = flk.Path_To + filesForTransmit[i].nameFile + "|" + flk.Path_From + filesForTransmit[i].nameFile; //Thread receiveThread = new Thread(new ParameterizedThreadStart(client.SendFileRequest)); //receiveThread.IsBackground = true; //receiveThread.Start(path); })); // var ans = RequestInteractivity.SendRequst(filesForTransmit[i].Receiver, RequestTipe.GetFileFromMe, filesForTransmit[i].RemoteLocationFilesOrDirectory + filesForTransmit[i].nameFile + "|" + filesForTransmit[i].RootLocationFilesOrDirectory + filesForTransmit[i].nameFile); } // Если это папка else { await Task.Run(() => _calculatingForDirectory(filesForTransmit[i])); } } // Если отправитель удаленный пк else { // Если это файл if (filesForTransmit[i].sizeFile != "") { System.Windows.Application.Current.Dispatcher.Invoke(DispatcherPriority.Render, new Action( () => { UserControl1 flk = new UserControl1(); flk.Name_ = filesForTransmit[i].nameFile; flk.Ip_From = filesForTransmit[i].Sender; flk.Ip_To = filesForTransmit[i].Receiver; flk.Path_From = filesForTransmit[i].RootLocationFilesOrDirectory; flk.Path_To = filesForTransmit[i].RemoteLocationFilesOrDirectory; window.tiktak.Items.Add(new MenuItem() { Title = filesForTransmit[i].nameFile, flk = flk }); var client = new TcpFileClient(filesForTransmit[i].Sender); //Подписываемся на события client.SendingEvent += flk.ChangedvalueForProgressBar; client.FailEvent += flk.SendingFailMessage; client.ReadyEvent += flk.SendingSuccessfullyMessage; ////var ans = RequestInteractivity.SendRequst(ip_to, RequestTipe.GetFileFromMe, flk.Path_To + "|" + flk.Path_From); string path = flk.Path_To + filesForTransmit[i].nameFile + "|" + flk.Path_From + filesForTransmit[i].nameFile; client.SendFileRequest(path); // Запуск асинхронного метода })); } // Елси это папка else { await Task.Run(() => _calculatingForDirectory(filesForTransmit[i])); } } } }
private void SystemEventsSessionSwitch(object sender, SessionSwitchEventArgs e) { if (e.Reason == SessionSwitchReason.SessionUnlock) { if (ApplicationState.GetValue<bool>("optionExpertMode")) { /*check if the idle time is complete*/ var optionIddleTime = ApplicationState.GetValue<TimeSpan>("optionIddleTime"); /*get time of unlock*/ DateTime unlockTime = DateTime.Now; var notificationDate = ApplicationState.GetValue<DateTime>("lastNotificationNow"); TimeSpan diff = unlockTime.Subtract(notificationDate); if (diff > optionIddleTime) { /*allow unlock , the rest time is completed.*/ /*display green notification , now that you are refreshed lets continue.*/ var userControl1 = new UserControl1(); Thread.Sleep(2000); tb.ShowCustomBalloon(userControl1, PopupAnimation.Fade, 10000); var n = ApplicationState.GetValue<Notification>("notification"); n.StartNotifying( Convert.ToInt32(ApplicationState.GetValue<TimeSpan>("optionIddleTime").TotalSeconds)); } else { /*you have to rest ! n_n*/ Process.Start(@"C:\WINDOWS\system32\rundll32.exe", "user32.dll,LockWorkStation"); } } } if (e.Reason == SessionSwitchReason.SessionLock) { var n = ApplicationState.GetValue<Notification>("notification"); n.StopNotifying(); } }
public Form1() { InitializeComponent(); m_uc1 = new UserControl1(); elementHost1.Child = m_uc1; }
public void Listar() { Company emp = new Company(); for (int cont = 0; cont < 10; cont++) { emp.Nome = "Empresa" + cont; emp.NomeFantasia = "Fantasia" + cont; emp.Email = "email" + cont + "@mail.com"; emp.TipoServico = "Alimento"; emp.Senha = "senha" + cont; emp.Rua = "rua" + cont; emp.Bairro = "bairro" + cont; emp.Cnpj = long.Parse("" + cont + "" + cont + "" + cont + "" + cont + "" + cont); emp.Numero = int.Parse("" + cont + "" + cont); emp.Cep = int.Parse("" + cont + "" + cont + "" + cont + "" + cont + "" + cont + "" + cont); comp.CompAdd(emp); } int count = 0; foreach (var item in comp.selectAll()) { ProfileCompany profComp = new ProfileCompany(); profComp.Especialidade = "Especialidade" + count; profComp.Contato = "Contato" + count; profComp.HoraInicio = DateTime.Now; profComp.HoraFim = DateTime.Now; profComp.Telefone = int.Parse("" + count + "" + count + "" + count + "" + count + "" + count); profComp.Cep = emp.Cep; profComp.Cel = int.Parse("" + count + "" + count + "" + count + "" + count + "" + count); profComp.CodigoCompany = comp.selectAll().IndexOf(item); prof.ProfileAdd(profComp); count++; prof.AddAvaliacao(count, profComp.CodigoCompany, count); prof.AddAvaliacao(10, profComp.CodigoCompany, count); prof.ApuraAvaliacao(profComp.CodigoCompany); } foreach (var teste in prof.TopList(prof.selectAll())) { foreach (var teste2 in comp.selectAll()) { if (teste.CodigoCompany == comp.selectAll().IndexOf(teste2)) { UserControl1 te = new UserControl1(teste2.NomeFantasia); te.Location = new Point(0, local1); local1 = local1 + te.Height + 5; Top5.Controls.Add(te); } } } /*foreach (var ava in prof.selectEvaluation()) * { * foreach (var itemEmp in comp.selectAll()) { * if (ava.IndexEmp == comp.selectAll().IndexOf(itemEmp)) { * UserControl1 te = new UserControl1(ava.Nota); * te.Location = new Point(0, local1); * local1 = local1 + te.Height + 5; * Top5.Controls.Add(te); * } * } * }*/ lista = comp.selectAll(); foreach (var item in lista) { ExibirEmpresa exbEmp = new ExibirEmpresa(item.Nome, lista.IndexOf(item)); exbEmp.Location = new Point(0, local); local = local + exbEmp.Height + 5; Restaurantes.Controls.Add(exbEmp); } }
//Function that adds a note and within the funciton contains methods for connecting lines (Method called in ICommand 1) void AddToolTip() { UserControl1 y = new UserControl1(MyCanvas); MyCanvas.Children.Add(y); Matrix m = new Matrix(); m.Translate(300, 300); y.RenderTransform = new MatrixTransform(m); y.Drop += y_Drop; y.MouseDown += y_MouseDown; y.MouseEnter += y_MouseEnter; y.MouseLeave += y_MouseLeave; // y.setText((String)e.Data.GetData(DataFormats.Text)); }