private void FlashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { if (e.command == "quit") { this.Close(); } }
private void FlashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { Console.WriteLine("K600Form e.command = " + e.command); Console.WriteLine("K600Form e.args = " + e.args); if (e.command == "Close") { this.Close(); } else if (e.command == "dqgzm") { listBox1.Visible = true; } else if (e.command == "zyszl") { listView1.Visible = true; } else if (e.command == "Record") { } else if (e.command == "ESC") { listView1.Visible = false; listBox1.Visible = false; } }
private void flashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { // We only want to react if we got our command if ((e.command == "SZ" && e.args == "FH") || e.command == "Quit") { this.Close(); } }
private void FlashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { if (e.command == "hidezdy") { Manager.GetInstance().UnRegisterEvent(FlashFlashCommand); this.Close(); } else if (e.command == "DTC" && e.args == "FDJ") { ShowDTC(); } else if (e.command == "DLIST" && e.args == "FDJ") { ShowDLIST(); } else if (e.command == "hide") { HideControl(); } else if (e.command == "RJL" && e.args == "FDJ") { for (int i = 0; i < listViewDTC.Items.Count; i++) { string id = listViewDTC.Items[i].SubItems[0].Text.ToString().Trim(); string value = listViewDTC.Items[i].SubItems[1].Text.ToString().Trim(); Record(id, value); } } else if (e.command == "JL" && e.args == "FDJ") { for (int i = 0; i < listViewDATA.Items.Count; i++) { string select = listViewDATA.Items[i].SubItems[0].Text.ToString().Trim(); if (select == "√") { string id = listViewDATA.Items[i].SubItems[1].Text.ToString().Trim(); string value = listViewDATA.Items[i].SubItems[2].Text.ToString().Trim(); Record(id, value); } } } else if (e.command == "power") { if (Manager.GetInstance().Car.Power() == 2) { axShockwaveFlash1.SetVariable("enterBTN", "1"); } else { axShockwaveFlash1.SetVariable("enterBTN", "0"); } } else if (e.command == "youmeng") { UpdateData(); } }
private void FlashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { Console.WriteLine("e.command = " + e.command); Console.WriteLine("e.args = " + e.args); if (e.command == "quit") { Close(); } }
public void FlashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { SetTipValue(""); if (e.command == "power") { if (e.args == "off" || e.args == "acc") { } else if (BbValue.BaseValue != "" && RbValue.BaseValue != "") { UpdateRBValue(); } else { SetTipValue(""); } } else if (e.command == "BB") { if (e.args != "") { BbValue.BaseValue = e.args; UpdateRBValue(); } else { BbValue.Reset(); SetTipValue(""); } } else if (e.command == "RB") { if (e.args != "") { RbValue.BaseValue = e.args; UpdateRBValue(); } else { RbValue.Reset(); SetTipValue(""); } } else if (e.command == "ZL") { Record(); } ShowValue(); Console.WriteLine("e.command = " + e.command); Console.WriteLine("e.args = " + e.args); }
private void flashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { // We only want to react if we got our command if (e.command == "fanhui" || e.command == "duichu") { this.Close(); } else if (e.command == "caidan1" || e.command == "caidan2" || e.command == "caidan3" || e.command == "caidan4" || e.command == "caidan5") { selectTab(e.command); } }
private void onFSCommand(Object eventSender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent eventArgs) { if (serial.IsOpen == true) { //Flashからデータ受信 try { //シリアルデータを送信 serial.Write(eventArgs.args); sendText.Clear(); } catch (Exception ex) { //例外を拾った receiveText.AppendText("Data Transmission Failed:" + Environment.NewLine + ex.Message); } } }
private void axShockwaveFlash1_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { switch (e.command) { case "click": { showEarth(); } break; case "close": //Application.Exit(); break; default: break; } }
private void YTplayer_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { Console.Write("YTplayer_FSCommand: " + e.command.ToString() + "(" + e.args.ToString() + ")" + "\r\n"); }
public void FlashFlashCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { if (e.command == "power" || e.command == "sc" || e.command == "youmeng" || e.command == "speed") { if (BbValue.BaseValue != "" && RbValue.BaseValue != "") { UpdateRBValue(); } } else if (e.command == "vt") { ValueType = int.Parse(e.args); SetTipValue(0); if (ValueType == 1) { if (BbValue.BaseValue != "" && RbValue.BaseValue != "") { UpdateRBValue(); } } if (ValueType == 0) { StopTime(); } else { StartTime(); } } else if (e.command == "BB") { if (e.args != "") { BbValue.BaseValue = e.args; UpdateRBValue(); } else { BbValue.Reset(); SetTipValue(0); } } else if (e.command == "RB") { if (e.args != "") { RbValue.BaseValue = e.args; UpdateRBValue(); } else { RbValue.Reset(); SetTipValue(0); } } else if (e.command == "ZL") { Record(); } else if (e.args == "ZXJC" || e.args == "JC") { DataTable dataTable = AccessHelper.GetInstance().GetDataTableFromDB("SELECT * FROM Element WHERE ID ='" + e.command + "'"); DataRow[] rows = dataTable.Select(); Target = rows[0]; } ShowValue(); }
void flashShow_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { }
private void SearchEngineInterfaceFlash_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e) { switch (e.command) { case "exit": if (threadGetFileNames.IsAlive) { threadGetFileNames.Abort(); } this.Close(); break; case "search-clicked": string textForSearch = e.args; //on enter or button pressed. if (SearchDirectories.Count > 0) { if (threadGetFileNames.IsAlive) { threadGetFileNames.Abort(); } threadGetFileNames = new Thread(() => { long startSize = (long)Properties.Settings.Default.startingSize; long endSize = (long)Properties.Settings.Default.endingSize; DateTime startDate = Properties.Settings.Default.startingDate; DateTime endDate = Properties.Settings.Default.endingDate; string inlcudeExt = Properties.Settings.Default.searchingExtension; string excludeExt = Properties.Settings.Default.searchingDisableExtension; int sizeType = Properties.Settings.Default.searchingSizeType; int dateType = Properties.Settings.Default.searchingDatesType; bool lookForDates = Properties.Settings.Default.lookForDates; bool getContents = Properties.Settings.Default.searchForContent; int cacheExpire = Properties.Settings.Default.expireCacheDays; bool searchFromCache = Properties.Settings.Default.searchFromCache; if (!String.IsNullOrWhiteSpace(inlcudeExt)) { IncludingExtensionList = inlcudeExt.Split(','); } if (!String.IsNullOrWhiteSpace(excludeExt)) { ExcludingExtensionList = excludeExt.Split(','); } folder.InludingExtensionList = IncludingExtensionList; folder.ExcludingExtensionList = ExcludingExtensionList; FilesList.SearchString = Flash.GetSearchText(); GenerateFileNames(startDate, endDate, dateType, lookForDates, getContents, startSize, endSize, sizeType, inlcudeExt, excludeExt, searchFromCache, cacheExpire); }); Flash.StartInditerminateSateProcessing("Folder"); threadGetFileNames.Start(); } else { goto Browse; } break; case "clear-cache": try { if (Directory.Exists(CustomDataLocation)) { Directory.Delete(CustomDataLocation, true); } Directory.CreateDirectory(CustomDataLocation); SaveSearchingDirectories(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error"); } break; case "minimize": this.WindowState = FormWindowState.Minimized; break; case "foundlist-click": break; case "foundlist-dblclick": string locationOfFile = e.args; Process.Start("explorer.exe", "/select," + locationOfFile); break; case "openFile": locationOfFile = e.args; Process.Start(locationOfFile); break; case "openFolder": locationOfFile = e.args; Process.Start("explorer.exe", "/select," + locationOfFile); break; case "openFileInEditor": locationOfFile = e.args; Process.Start(locationOfFile); break; case "browse": //Flash.addListItem("Hello", "World"); //Flash.addListItem("Hello2", "World2"); //string s2 = Flash.getListItemAt(0); //Flash.clearList(); //MessageBox.Show(s2); Browse: string location = GetDirectory(); if (location != null && !SearchDirectories.Exists(m => m == location)) { if (strLocations != "") { strLocations += " ; "; //} else { // filesList.ListOfDirectories = new List<string>(); } strLocations += location; SearchDirectories.Add(location); SearchEngineInterfaceFlash.CallFunction("<invoke name='setLocation' returnType='void'><arguments><string>" + strLocations + "</string></arguments></invoke>"); } SaveSearchingDirectories(); //filesList.ListOfDirectories = SearchDirectories; //GenerateFileNames(); break; case "browse-clear": strLocations = ""; SearchDirectories.Clear(); SearchEngineInterfaceFlash.CallFunction("<invoke name='setLocation' returnType='void'><arguments><string>" + "Location: ?" + "</string></arguments></invoke>"); Flash.clearList(); RemoveSearchingDirectories(); Flash.StopInditerminateSateProcessing(); Flash.FlashStopGlobalTimer(); break; case "load-setting": //string s = SearchEngineInterfaceFlash.CallFunction("<invoke name='getSetting'></invoke>"); //MessageBox.Show(s); LoadSearchingDirectories(); string[] setting = new string[14]; setting[0] = Properties.Settings.Default.searchingDisableExtension; setting[1] = Properties.Settings.Default.searchingExtension; setting[2] = Properties.Settings.Default.searchingSizeType.ToString(); setting[3] = Properties.Settings.Default.startingSize.ToString(); setting[4] = Properties.Settings.Default.endingSize.ToString(); setting[5] = Properties.Settings.Default.lookForDates.ToString(); setting[6] = Properties.Settings.Default.searchingDatesType.ToString(); setting[7] = Properties.Settings.Default.startingDate.ToString(); setting[8] = Properties.Settings.Default.endingDate.ToString(); setting[9] = Properties.Settings.Default.searchForContent.ToString(); setting[10] = Properties.Settings.Default.contentFoundMany.ToString(); setting[11] = Properties.Settings.Default.searchFromDatabase.ToString(); setting[12] = Properties.Settings.Default.searchFromCache.ToString(); setting[13] = Properties.Settings.Default.expireCacheDays.ToString(); string s = ""; foreach (var item in setting) { if (s.ToString() != "") { s += ";"; } else { } s += item; } //MessageBox.Show(s); //Clipboard.Clear(); //Clipboard.SetText(s); string request = "<invoke name='setSetting' returnType='void'><arguments><string>" + s + "</string></arguments></invoke>"; Flash.CallFunction(request); break; case "save-setting": string settingStr = SearchEngineInterfaceFlash.CallFunction("<invoke name='getSetting'></invoke>"); //MessageBox.Show(settingStr); XDocument xdoc = XDocument.Parse(settingStr); var list = xdoc.Descendants("string").ToList(); //foreach (var item in list) { // MessageBox.Show(item.Value.ToString()); //} Properties.Settings.Default.searchingDisableExtension = list[0].Value; Properties.Settings.Default.searchingExtension = list[1].Value; try { Properties.Settings.Default.lookForDates = Boolean.Parse(list[5].Value); Properties.Settings.Default.searchForContent = Boolean.Parse(list[9].Value); Properties.Settings.Default.contentFoundMany = Boolean.Parse(list[10].Value); Properties.Settings.Default.searchFromDatabase = Boolean.Parse(list[11].Value); Properties.Settings.Default.searchFromCache = Boolean.Parse(list[12].Value); } catch (Exception ex) { MessageBox.Show("Message : " + ex.Message.ToString(), "Error - Boolean", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { Properties.Settings.Default.searchingSizeType = int.Parse(list[2].Value); Properties.Settings.Default.startingSize = int.Parse(list[3].Value); Properties.Settings.Default.endingSize = int.Parse(list[4].Value); Properties.Settings.Default.searchingDatesType = int.Parse(list[6].Value); Properties.Settings.Default.expireCacheDays = int.Parse(list[13].Value); //expireCache } catch (Exception ex) { MessageBox.Show("Message : " + ex.Message.ToString(), "Error - Number", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { Properties.Settings.Default.startingDate = DateTime.Parse(list[7].Value); } catch (Exception ex) { MessageBox.Show("Message : " + ex.Message.ToString(), "Error - Starting Date", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { Properties.Settings.Default.endingDate = DateTime.Parse(list[8].Value); } catch (Exception ex) { MessageBox.Show("Message : " + ex.Message.ToString(), "Error - Ending Date", MessageBoxButtons.OK, MessageBoxIcon.Error); } Properties.Settings.Default.Save(); break; default: break; } }