public Form_VarsAndFunctions(Form_Main form_mainT) { InitializeComponent(); form_main = form_mainT; initParams(); }
void OnFinish() { this.Hide(); Form_Main mf = new Form_Main(); mf.ShowDialog(); }
public Form_VarsAndFunctions(Form_Main form_mainT) { InitializeComponent(); form_main = form_mainT; initParams(); }
private void matchData() { string sqlstring = "SELECT * from Users_Log where Username LIKE '" + tb_username.Text + "' AND User_Password LIKE '" + tb_password.Text + "'"; using (OleDbConnection conn = new OleDbConnection(connstring)) { using (OleDbDataAdapter adapter = new OleDbDataAdapter(sqlstring, conn)) { DataSet ds = new DataSet(); adapter.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { type = ds.Tables[0].Rows[0]["User_Type"].ToString(); User_Logged(); this.Hide(); Form_Main f = new Form_Main(); f.Show(); } else { MessageBox.Show("Username or Password not found"); } } } }
private void btnConnect_Click(object sender, EventArgs e) { if ((this.tbServer.Text == ".\\" || this.tbServer.Text == "") && this.tbDBName.Text == "") //jika kedua textbox kosong { MessageBox.Show("Please enter the valid Server and Database name!", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); // tampilkan pesan } else { string connection = this.tbServer.Text; // teks dari tbServer sebagai string koneksi string dbName = this.tbDBName.Text; // teks dari DBName sebagai string dbName Connector bridge = new Connector(connection, dbName); // inisialisasi koneksi ke dataabse if (bridge.QueryStatus == false) // jika query inisialisasi gagal, tampilkan pesan { MessageBox.Show(bridge.ErrorMessage, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); } else //jika tidak { using (Form form = new Form_Main(bridge)) //buka form utama { this.Hide(); form.ShowDialog(); this.Close(); } } } }
private void button1_Click(object sender, EventArgs e) { string uprawnienia = ""; if (t_login.Text == "" || t_haslo.Text == "") { MessageBox.Show("Prosze wpisać dane logowania"); return; } var exist = from a in dc.GetTable <Uzytkownicy>() where a.login_uzytkownika == t_login.Text && a.haslo == t_haslo.Text select a; if (exist.Any()) { foreach (var user in exist) { if (user.haslo != t_haslo.Text || user.login_uzytkownika != t_login.Text) { MessageBox.Show("Dane logowania są niepoprawne"); return; } uprawnienia = user.Uprawnienia; } MONGO.MongoDB.Add_action(t_login.Text, "Zalogowano", DateTime.Now); Form_Main Main = new Form_Main(t_login.Text, uprawnienia); Main.ShowDialog(); } else { MessageBox.Show("Dane logowania są niepoprawne"); } }
public static void Main_SetSettings(Form_Main frm) { Thread P_thread = new Thread( () => //lambda表达式(参数列表)=>{执行语句} lambda表达式是比匿名方法更加简洁的一种匿名函数语法 { frm.Invoke(new MethodInvoker(delegate() { ///////////////设置style frm.label1.ForeColor = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetMainColor(); frm.panel1.BackColor = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetMainColor(); frm.tabPage1.BackColor = frm.tabPage2.BackColor = frm.tabPage3.BackColor = frm.tabPage4.BackColor = frm.tabPage5.BackColor = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetPanelColor(); frm.flowLayoutPanel_usepings.BackColor = frm.flowLayoutPanel1.BackColor = frm.flowLayoutPanel2.BackColor = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetPanelColor(); frm.panel2.BackColor = frm.panel7.BackColor = frm.panel8.BackColor = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetPanelColor(); frm.BackColor = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetPanelColor(); ///////////////////logo frm.myModernButton2.ButtonSmallLogo = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S01", false); frm.myModernButton4.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S06", false); frm.myModernButton5.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S05", false); frm.myModernButton6.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S02", false); //frm.myModernButton7.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.Skins.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.Skins.GetSkin_GetImageType.FunctionLogo, "S03", false); frm.myModernButton8.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S01", false); frm.myModernButton12.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S03", false); frm.myModernButton9.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S08", false); frm.myModernButton10.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S04", false); frm.myModernButton11.ButtonBackImage = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S07", false); frm.myModernButton1.ButtonSmallLogo = MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageLocationWithPicture(MyFunctions.ApplicationAndEnvironmentInformation.ApplicationSettings.SkinsAndResources.GetSkin_GetImageType.FunctionLogo, "S03", false); // frm.myModernButton1.ButtonBackImage = Class_SystemStyle.SystemStyle_SortingFile_LoadConditionToTile(); })); }); //new thread P_thread.IsBackground = true; P_thread.Start(); }
private Form_CombineRes(Form_Main currentFormT, Form_Main srcFormT) { InitializeComponent(); currentForm = currentFormT; srcForm = srcFormT; updated = false; initParams(); }
private Form_CombineRes(Form_Main currentFormT, Form_Main srcFormT) { InitializeComponent(); currentForm = currentFormT; srcForm = srcFormT; updated = false; initParams(); }
public Form_DB_Info(Form_Main form1) { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true); mainForm = form1; }
public fmCheckXI(DataGridView FeederCtrl, int feederNo, Form_Main parent = null) { InitializeComponent(); this.parent = parent; this.feederNo = feederNo; this.Feeder = this.parent.Feeder[this.feederNo]; this.FeederCtrl = FeederCtrl; }
public static StageElement createStageElement(StageGroup group, Form_Main form_MainT) { form_Main = form_MainT; element = new StageElement(group); SmallDialog_Stage dialog = new SmallDialog_Stage("新建场景",true); dialog.ShowDialog(); return element; }
public static StageElement createStageElement(StageGroup group, Form_Main form_MainT) { form_Main = form_MainT; element = new StageElement(group); SmallDialog_Stage dialog = new SmallDialog_Stage("新建场景", true); dialog.ShowDialog(); return(element); }
public Form_Save(Form_Main _fmain, int i) { InitializeComponent(); fmain = _fmain; connector = new DBconnector(); combo_from_db(); i_from = i; }
private void pictureBox1_Click(object sender, EventArgs e) { this.Dispose(); string[] str = new string[1]; str[0] = "-B"; Form_Main frm = new Form_Main(str); frm.Show(); }
public void SetComputeDevices(List <ComputeDevice> computeDevices) { // to not run callbacks when setting new bool tmp_SaveToGeneralConfig = SaveToGeneralConfig; SaveToGeneralConfig = false; listViewDevices.BeginUpdate(); listViewDevices.Items.Clear(); // set devices foreach (var computeDevice in computeDevices) { String txt; Color c = Color.White; if (computeDevice.DeviceType.Equals(Enums.DeviceType.CPU)) { if (computeDevice.Temp == 0) { txt = "Temperature: N/A Run as Adminstrator Required / Load: " + computeDevice.Load.ToString("0.00") + " % "; } else { txt = "Temperature: " + computeDevice.Temp.ToString("0.00") + "°C / " + "Load: " + computeDevice.Load.ToString("0.00") + "%"; } } else { txt = "Temperature: " + Math.Truncate(computeDevice.Temp).ToString() + "°C" + " / Fan Speed: " + computeDevice.FanSpeed.ToString() + "%" + " / Load: " + Math.Truncate(computeDevice.Load).ToString() + "%"; Form_Main form = (Form_Main)ParentForm; if (computeDevice.Temp < ConfigManager.GeneralConfig.tempLowThreshold && computeDevice.Enabled && form.getDevicesListControl().IsMining&& ConfigManager.GeneralConfig.beep) { Console.Beep(); c = Color.LightBlue; } else if (computeDevice.Temp > ConfigManager.GeneralConfig.tempHighThreshold && computeDevice.Enabled && form.getDevicesListControl().IsMining&& ConfigManager.GeneralConfig.beep) { c = Color.LightSalmon; Console.Beep(); } } ListViewItem lvi = new ListViewItem { //lvi.SubItems.Add(computeDevice.Name); Checked = computeDevice.Enabled, Text = txt, Tag = computeDevice }; lvi.ForeColor = c; listViewDevices.Items.Add(lvi); _listItemCheckColorSetter.LviSetColor(lvi); } listViewDevices.EndUpdate(); listViewDevices.Invalidate(true); // reset properties SaveToGeneralConfig = tmp_SaveToGeneralConfig; }
private void btn_login_Click(object sender, EventArgs e) { User user = new User("", "", "", false, ""); user = controller_login.authenticator(txb_loginUsername.Text, txb_loginPassword.Text); Form_Main form_main = new Form_Main(txb_loginUsername.Text.ToString()); this.Hide(); form_main.Show(); }
//从其它文档导入动画到当前工程 public static bool importAnims(Form_Main currentForm, String srcPath) { Form_Main srcForm = new Form_Main(srcPath); srcForm.initWorld(); Form_CombineRes dialog = new Form_CombineRes(currentForm, srcForm); dialog.ShowDialog(); return(updated); }
public MClipsManager CloneReference(Form_Main form_MAT) { MClipsManager newInstance = new MClipsManager(form_MAT); for (int i = 0; i < Count(); i++) { newInstance.Add(this[i].Clone()); } return(newInstance); }
// For the Main Form thread public void Main() { if (this.game_form != null) { this.game_form.Dispose(); } this.game_form = new Form_Main(xmlDoc); if (radioButton_camera.Checked) { this.game_form.setCaptureDeviceIndex(capture_device_index); } else { this.game_form.setLoadedVideoPath(loaded_video_path); } //send the configuration to the main (parent) form: // check if the position of the team has changed to also switch the team points: if (team1_up != configuration.TeamAup) { String temp_up_points = game_form.textBox_scoreteamup.Text; game_form.textBox_scoreteamup.Text = game_form.textBox_scoreteamdown.Text; game_form.textBox_scoreteamdown.Text = temp_up_points; configuration.TeamAup = team1_up; // now we can save the current team positions } // set the correct team labels if (team1_up) { game_form.textBox_teamupname.Text = configuration.Teama.Name; game_form.textBox_teamdownname.Text = configuration.Teamb.Name; game_form.radioButton_playerupleft.Text = configuration.Teama.Player1.Name; game_form.radioButton_playerupright.Text = configuration.Teama.Player2.Name; game_form.radioButton_playerdownleft.Text = configuration.Teamb.Player1.Name; game_form.radioButton_playerdownright.Text = configuration.Teamb.Player2.Name; } else { game_form.textBox_teamupname.Text = configuration.Teamb.Name; game_form.textBox_teamdownname.Text = configuration.Teama.Name; game_form.radioButton_playerupleft.Text = configuration.Teamb.Player1.Name; game_form.radioButton_playerupright.Text = configuration.Teamb.Player2.Name; game_form.radioButton_playerdownleft.Text = configuration.Teama.Player1.Name; game_form.radioButton_playerdownright.Text = configuration.Teama.Player2.Name; } Application.EnableVisualStyles(); Application.Run(game_form); }
private void Button_Update_Click(object sender, EventArgs e) { if (UpdateAvailable) { Form_Main.DownloadUpdate(); } else { Interface.VersionCheck.Request(VersionCheck_Callback_FromButton); } }
public MImgsManager Clone(Form_Main form_MainT) { MImgsManager newInstance = new MImgsManager(form_MainT); for (int i = 0; i < Count(); i++) { newInstance.Add(this[i].Clone(newInstance), false); } newInstance.ui = ui; return(newInstance); }
public Form_Select(Form_Main _fMain, string _strType) { InitializeComponent(); connector = new DBconnector(); str_FormType = _strType; fMain = _fMain; select_to_listview(); }
//设置地图单元 public static void configMapElement(StageElement elementT, Form_Main form_MainT) { form_Main = form_MainT; if (elementT == null) { Console.WriteLine("error in configMapElement"); return; } element = elementT; SmallDialog_Stage dialog = new SmallDialog_Stage("设置场景",false); dialog.ShowDialog(); }
public Form_Select_Other(Form_Main _fmain) { InitializeComponent(); pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; connector = new DBconnector(); fMain = _fmain; listview_from_DB(); combobox_setting_item(); }
public MClipsManager Clone(Form_Main form_MAT) { MClipsManager newInstance = new MClipsManager(form_MAT); for (int i = 0; i < Count(); i++) { MClipElement clipElement = (MClipElement)this[i]; MClipElement newClip = clipElement.Clone(newInstance); newInstance.Add(newClip); } return(newInstance); }
/*********************************** END OF VARIABLE DEFINITIONS ***********************************************************************/ public Form_Configuration(Form_Main parent) { InitializeComponent(); this.parent_form = parent; configuration = Program.getConfiguration(); // Default: Team 1 is down team1_up = false; }
public Popup(string title, string text, bool yesNo = false) { InitializeComponent(); if (yesNo) { button_no.Visible = true; button_yes.Visible = true; button_quit.Visible = false; } label_title.Text = title; richTextBox_text.Text = text; Form_Main.FadeIn(this, 10); }
//设置地图单元 public static void configMapElement(StageElement elementT, Form_Main form_MainT) { form_Main = form_MainT; if (elementT == null) { Console.WriteLine("error in configMapElement"); return; } element = elementT; SmallDialog_Stage dialog = new SmallDialog_Stage("设置场景", false); dialog.ShowDialog(); }
public Form_Cloning(Form_Main _fmain) { InitializeComponent(); connector = new DBconnector(); list_from_DB(); i_SP = (int)(pn_view.Size.Width * 0.1); i_EP = (int)(pn_view.Size.Width * 0.9); fmain = _fmain; }
public FKConsoleWrapper() { m_Log = new Log(null); m_Log.AddInfo(Log.ENUM_Level.UserInfo, "================= APP START ================="); HideConsoleWindow(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); if (m_MainForm == null) { m_MainForm = new Form_Main(this); } }
private void CalLoop() { while (!Exit) { if (!this.calQueue.IsEmpty) { ResultItem item = null; try { #region 计算 if (this.calQueue.TryDequeue(out item)) { Stopwatch watch = new Stopwatch(); watch.Restart(); // 如果已有该吸嘴得计算结果顶替掉 Z_RunParam zParam = Form_Main.Instance.Z_RunParamMap[item.Nozzle]; var camera = Form_Main.Nozzle2Cam((int)item.Nozzle); // 算法 zParam.CamResult = Form_Main.Instance.Auto_Detect1(ref Form_Main.Instance.Feeder[zParam.RUN_Nozzle_FeederIndex - 1].Label, zParam.CaptureImage, camera.Item1, (int)item.Nozzle); Form_Main.Instance.CalNozzle(item.Nozzle, camera.Item1, camera.Item2); zParam.CalFinished = true; Form_Main.Instance.ShowVisionStatus((int)(item.Nozzle + 1), zParam.CamResult, zParam.CaptureImage); Debug.WriteLine($"下视觉计算时间:{watch.ElapsedMilliseconds} ms"); } #endregion } catch (Exception ex) { if (item != null) { // 如果已有该吸嘴得计算结果顶替掉 Z_RunParam zParam = Form_Main.Instance.Z_RunParamMap[item.Nozzle]; zParam.CalFinished = true; zParam.RUN_dNozzleDownVisionED = 4; Form_Main.Instance.PutInLog("D://下视觉//", "Log", $"下视觉计算错误 {ex.Message} \n 错误所在:{ex.StackTrace} 吸嘴{item.Nozzle + 1},贴附信息{zParam.RUN_PasteInfoIndex},{zParam.RUN_PastePointIndex}");// } } } else { Thread.Sleep(1); } } }
public PopupImage(string title, Image img, bool yesNo = false) { InitializeComponent(); if (yesNo) { button_no.Visible = true; button_yes.Visible = true; button_quit.Visible = false; } label_title.Text = title; pictureBox_image.BackgroundImage = img; pictureBox_image.BackgroundImageLayout = ImageLayout.Stretch; //richTextBox_text.Text = text; Form_Main.FadeIn(this, 10); }
//设置地图块对象单元 public static void configElement(Form_Main form_mainT, TileObjectElement elementT, String title) { form_main = form_mainT; if (elementT == null) { Console.WriteLine("error in configElement"); return; } element = elementT; SmallDialog_ConfigMapObj dialog = new SmallDialog_ConfigMapObj(title); element.keyValueManager.MNodeUI = dialog; dialog.showParamsList(); dialog.ShowDialog(); }
//########################################### 构造和初始化 ####################################################### //private Form_BaseClipsEditor clipsManager = null; public Form_MAnimation(Form_Main form_MainT) { InitializeComponent(); form_Main = form_MainT; Control.CheckForIllegalCrossThreadCalls = false; layoutPath = Consts.PATH_EXE_FOLDER + "\\layout_local.xml"; form_MActorList = new Form_MActorsList(this); form_MFrameEdit = new Form_MFrameEdit(this); form_MFrameLevel = new Form_MFrameLevel(this); form_MConfig = new Form_MConfig(this); form_MImgsList = new Form_MImgsList(this); form_MCLib = new Form_MCLib(); form_MTimeLine = new Form_MTimeLine(this); form_MAnimPW = new Form_MAnimPlay(this); dockContentes.Add(form_MActorList); dockContentes.Add(form_MFrameEdit); dockContentes.Add(form_MFrameLevel); dockContentes.Add(form_MConfig); dockContentes.Add(form_MImgsList); dockContentes.Add(form_MCLib); dockContentes.Add(form_MTimeLine); dockContentes.Add(form_MAnimPW); for (int i = 0; i < dockContentes.Count; i++) { DockContent dockI = ((DockContent)dockContentes[i]); dockI.HideOnClose = true; dockI.DockStateChanged += new EventHandler(all_DockStateChanged); dockI.SizeChanged += new EventHandler(all_DockStateChanged); dockI.FormClosing += new FormClosingEventHandler(all_DockContentClosing); } if (File.Exists(layoutPath)) { DeserializeDockContent dsd = new DeserializeDockContent(IDockContentMe); panel_DockPanel.LoadFromXml(layoutPath, dsd); refreshDockState(); } else { resetPanels(); } historyManager = new MA_HistoryManager(this); }
public SmallDialog_LevelEyes(Form_Main form) { InitializeComponent(); needUpdate = false; trackBar_PHY.Value = Consts.LEVEL_ALPHA_FLAG_PHY; trackBar_BG.Value = Consts.LEVEL_ALPHA_TILE_BG; trackBar_SUR.Value = Consts.LEVEL_ALPHA_TILE_SUR; trackBar_Tile_OBJ.Value = Consts.LEVEL_ALPHA_TILE_OBJ; trackBar_OBJ_Mask.Value = Consts.LEVEL_ALPHA_OBJ_MASK; trackBar_OBJ.Value = Consts.LEVEL_ALPHA_OBJ_TRIGEER; alpha_phy = Consts.LEVEL_ALPHA_FLAG_PHY; alpha_bg = Consts.LEVEL_ALPHA_TILE_BG; alpha_sur = Consts.LEVEL_ALPHA_TILE_SUR; alpha_tile_bg = Consts.LEVEL_ALPHA_TILE_OBJ; alpha_obj_bg = Consts.LEVEL_ALPHA_OBJ_MASK; alpha_obj = Consts.LEVEL_ALPHA_OBJ_TRIGEER; form_main = form; }
public PropertiesManager(PropertyTypeElement parentT, Form_Main form_mainT) { parent = parentT; form_main = form_mainT; }
public PropertyTypesManager(Form_Main form_mainT) { form_main = form_mainT; }
//从其它文档导入动画到当前工程 public static bool importAnims(Form_Main currentForm, String srcPath) { Form_Main srcForm = new Form_Main(srcPath); srcForm.initWorld(); Form_CombineRes dialog = new Form_CombineRes(currentForm, srcForm); dialog.ShowDialog(); return updated; }
public SmallDialog_ExportConfig(Form_Main mainForm) { InitializeComponent(); this.mainForm = mainForm; }
public SmallDialog_History(Form_Main form) { InitializeComponent(); form_main = form; }
//从用户文档创建数据资源(如果文档不存在,则创建空数据资源) public UserDoc(Form_Main mainFormP) { mainForm = mainFormP; }
public Form_ProptiesManager(Form_Main form_mainT) { InitializeComponent(); form_main = form_mainT; initParams(true); }
public FunctionsManager(Form_Main form_mainT) { form_main = form_mainT; }
public static bool inExportVARTable = true;//是否正在导出变量数据 public VarsManager(Form_Main form_mainT) { form_main = form_mainT; }
//文字单元列表 //public ArrayList objList = new ArrayList(); public TextsManager(Form_Main form_mainT) { form_main = form_mainT; objList = new ArrayList(); }