public void endZoomClick() { this.Visible = false; int zoomWidth = (int)(bmp.Width * SettingsSingleton.Instance().ZoomMagnification); int zoomHeight = (int)(bmp.Height * SettingsSingleton.Instance().ZoomMagnification); int borderX = (zoomWidth - bmp.Width) / 2; int borderY = (zoomHeight - bmp.Height) / 2; if (fx != null) { int mouseOnFormX = fx.X - Left; int mouseOnFormY = fx.Y - Top; Point mousePos = new Point((int)(((mouseOnFormX + borderX) / SettingsSingleton.Instance().ZoomMagnification) + Left), (int)(((mouseOnFormY + borderY) / SettingsSingleton.Instance().ZoomMagnification) + Top)); mousePos.X += formOffset.X; mousePos.Y += formOffset.Y; ClickPoint(mousePos); } running = false; this.Hide(); }
public void startZoomClick(KeyCombo inputCommand) { if (!running) { running = true; int xPos = MousePosition.X - (Width / 2); int yPos = MousePosition.Y - (Height / 2); GetFormPos(xPos, yPos); g.FillRectangle(Brushes.Black, Bounds); g.CopyFromScreen(xPos, yPos, 0, 0, new Size(Width, Height)); int zoomWidth = (int)(bmp.Width * SettingsSingleton.Instance().ZoomMagnification); int zoomHeight = (int)(bmp.Height * SettingsSingleton.Instance().ZoomMagnification); int zoomXPos = -((zoomWidth - bmp.Width) / 2); int zoomYPos = -((zoomHeight - bmp.Height) / 2); zoomRect = new Rectangle(zoomXPos, zoomYPos, zoomWidth, zoomHeight); zoomCounter = 0; this.inputCommand = inputCommand; this.Visible = true; DrawScreen(); zoomTimer.Start(); } }
public VoxVisio() { InitializeComponent(); this.component = new Container(); // Create the NotifyIcon. notifyicon = new NotifyIcon(component); notifyicon.MouseDoubleClick += notifyIcon_MouseDoubleClick; // The Icon property sets the icon that will appear // in the systray for this application. Icon icon = Resources.favicon; notifyicon.Icon = icon; // The Text property sets the text that will be displayed, // in a tooltip, when the mouse hovers over the systray icon. notifyicon.Text = "VoxVisio"; this.Resize += frmMain_Resize; mainEngine = new MainEngine(); _settingsList = SettingsSingleton.Instance(); populateList(); }
private void frmNDoc_Load(object sender, EventArgs e) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); int ret = 0; SettingsSingleton.getValue(SettingsSingleton.KeyNDocTop, out ret); if (ret > 0) { this.Top = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyNDocLeft, out ret); if (ret > 0) { this.Left = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyNDocWidth, out ret); if (ret > 0) { this.Width = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyNDocHeight, out ret); if (ret > 0) { this.Height = ret; } con.CloseConnection(); } }
void Start() { placeObjects = new Vector3[4]; activeIndices = new List <int>(); waypointIndices = new List <int>(); settings = GameObject.Find("Settings").GetComponent <SettingsSingleton>(); if (settings == null) { Debug.Log("No settings object found!"); } else { setScale(); //movementSpeed *= scale; } scaleScript = scaleWallObject.GetComponent <ScaleWallBasedOnTracker>(); if (!scaleScript) { Debug.Log("No scale wall script found!"); } //Set trigger parameters triggerCapsule = GetComponent <CapsuleCollider>(); triggerCapsule.radius = movingTriggerRadius * scale; triggerCapsule.height = capsuleHeight; triggerSphere = GetComponentInChildren <SphereCollider>(); //Disable stopped particle stoppedParticleSystem.GetComponent <ParticleSystem>().Stop(true); stoppedParticleSystem.GetComponent <Light>().enabled = false; }
public void InstanceTest() { SettingsSingleton cs = SettingsSingleton.Instance(); SettingsSingleton cs2 = SettingsSingleton.Instance(); Assert.AreEqual(cs, cs2); }
public CommandState() { inputsim = SharedObjectsSingleton.Instance().inputSimulator; commandList = SettingsSingleton.Instance().Commands; zoomForm = SharedFormsSingleton.Instance().zoomForm; scrollManager = new ScrollManager(); keyboardManager = new KeyboardManager(); toastOverlay = SharedFormsSingleton.Instance().ToastOverlay; }
private void DoSaveSettingsExecute() { Mouse.OverrideCursor = System.Windows.Input.Cursors.Wait; try { SettingsSingleton.getInstance().SaveSettings(); } catch (Exception ex) { MessageBox.Show("Exception found on DoSaveSettingsExecute :" + ex.Message); } Mouse.OverrideCursor = System.Windows.Input.Cursors.Arrow; }
void Awake() { if (instance != null && instance != this) { Destroy(this.gameObject); return; } else { instance = this; } DontDestroyOnLoad(this.gameObject); }
public void SetCommandsTest() { SettingsSingleton cs = SettingsSingleton.Instance(); SettingsSingleton cs2 = SettingsSingleton.Instance(); List <Command> commands = new List <Command>(); commands.Add(new VoiceCommand("open", "enter", new InputSimulator())); cs.SetCommands(commands); Assert.AreEqual(cs.Commands, cs2.Commands); commands.Add(new VoiceCommand("click", "m1", new InputSimulator())); Assert.AreEqual(cs.Commands.Count, 2); Assert.AreEqual(cs2.Commands.Count, 2); }
private void frmNDoc_FormClosing(object sender, FormClosingEventArgs e) { using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); SettingsSingleton.setValue(SettingsSingleton.KeyNDocTop, this.Top); SettingsSingleton.setValue(SettingsSingleton.KeyNDocLeft, this.Left); SettingsSingleton.setValue(SettingsSingleton.KeyNDocWidth, this.Width); SettingsSingleton.setValue(SettingsSingleton.KeyNDocHeight, this.Height); con.CloseConnection(); } }
public SettingsForm() { InitializeComponent(); settings = SettingsSingleton.Instance(); //Populate the command lists with the loaded commands updateTables(null, eListEvent.ItemAdded); //A counter that makes sure when the user clicks on the text box to add key presses, the initial mouse click is not added. commandFocusCounter = 0; //Bind the update tables method to the change event of the command list settings.Commands.OnChange += updateTables; //Load all of the settings into the controls so they display the correct information setUpSettingsControls(); setDebugEyeState(); }
public DictationState() { inputsim = SharedObjectsSingleton.Instance().inputSimulator; toast = SharedFormsSingleton.Instance().ToastOverlay; if (SettingsSingleton.Instance().DragonEnabled) { dictation = new DragonDictation(); } else { dictation = new WindowsDictation(); } Settings.Default.PropertyChanged += CheckState; }
void Awake() { //Check if there is an instance of the settings handler that already exists, if not assign this to be the settings handler. Otherwise destroy this gameObject. #region Instance Creation/check if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } #endregion DontDestroyOnLoad(gameObject); }
public MainEngine(MainSystemTray form) { //Fetch the list of commands commandList = SettingsSingleton.Instance().Commands; // Create the speech recognition engine speechRecognizer = createSpeechRecogntionEngine(form); stateController = new StateController(); //Register to the event that provides the fixations EventSingleton.Instance().fixationEvent += sharedData_fixationEvent; //Register to the event that fires when keyboard keys are pressed EventSingleton.Instance().systemHook.KeyDown += sharedData_keyboardEvent; speechRecognizer.SpeechRecognized += SpeechRecognised; }
private void chkbxOptikeyEnabled_CheckedChanged(object sender, EventArgs e) { //if the check box is checked, and a file path has been set, then allow the program to be enabled, otherwise give an error. if (chkbxOptikeyEnabled.Checked && File.Exists(Settings.Default.OptiKeyFileAddress)) { SettingsSingleton.Instance().OptiKeyEnabled = true; } else if (chkbxOptikeyEnabled.Checked) { MessageBox.Show("You must fist add an address for the OptiKey .exe file", "Error", MessageBoxButtons.OK); chkbxOptikeyEnabled.Checked = false; } else { SettingsSingleton.Instance().OptiKeyEnabled = false; } }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { this.cmbReflectTarget.Save(); this.cmbPrefix.Save(); using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormTop, this.Top); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormLeft, this.Left); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormWidth, this.Width); SettingsSingleton.setValue(SettingsSingleton.KeyMainFormHeight, this.Height); con.CloseConnection(); } }
void Awake() { if (_instance == null) { //If I am the first instance, make me the Singleton _instance = this; DontDestroyOnLoad(this); } else { //If a Singleton already exists and you find //another reference in scene, destroy it! if (this != _instance) { Destroy(this.gameObject); } } }
public MainEngine() { sharedData = SharedDataSingleton.Instance(); _settingsList = SettingsSingleton.Instance(); inputSimulator = sharedData.inputSimulator; controlState = new ControlContext(); controlState.changedState += StateChanged; controlState.ControlState = new CommandState(inputSimulator, controlState); //System.Diagnostics.Process.Start("C:/Program Files (x86)/Nuance/NaturallySpeaking13/Program/natspeak.exe"); SetupSpeechRecognition(); //Instantiating and starting the eye tracker host eyex = new EyeXHost(); eyex.CreateFixationDataStream(FixationDataMode.Sensitive).Next += (s, e) => Fixation(e.EventType, (int)e.X, (int)e.Y, e.Timestamp); eyex.Start(); }
private void btnOk_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.tbxNDocComnment.Text)) { MessageBox.Show("テキストボックスが空です。"); return; } if (string.IsNullOrEmpty(lblTargetName.Text)) { MessageBox.Show("ターゲットが空です。"); return; } using (DAOContext con = new DAOContext(AccessConstring.jpDBConString)) { con.OpenConnection(); SettingsSingleton.setValue(con, this.NDocHeader + this.lblTargetName.Text, this.tbxNDocComnment.Text); con.CloseConnection(); } this.Close(); }
public bool VoiceInput(string voiceData) { if (SettingsSingleton.Instance().OptiKeyEnabled) // HACK : There would be an easier way to do this with a change to the Keyboard manager's interaction structure. { switch (voiceData) { case "start keyboard": StartKeyboard(); return(true); case "stop keyboard": StopKeyboard(); return(true); default: return(false); } } return(false); }
public void RunCommand() { if ((keyCombo.GetKeyString().Contains("LButton") || keyCombo.GetKeyString().Contains("RButton")) && SettingsSingleton.Instance().ZoomEnabled) { SharedFormsSingleton.Instance().zoomForm.startZoomClick(keyCombo); } else { keyCombo.PressKeys(); } }
public SettingsViewModel() { SettingsHolder = SettingsSingleton.getInstance().GetSettings(); }
private void chkbxDebugEyeTracking_CheckedChanged(object sender, EventArgs e) { SettingsSingleton.Instance().DebugEyeMouseMode = chkbxDebugEyeTracking.Checked; setDebugEyeState(); }
public void Arrange() { settingsSingleton = SettingsSingleton.Instance; testTextChanger = new TextChanger(); }
public void SaveJpNameToDB() { //prefix string prefix = this.cmbPrefix.Text.Trim(); if (string.IsNullOrEmpty(prefix)) { prefix = string.Empty; } // english string returnTypeEn = this.tbxReturnType.Text; string funcnameEn = this.tbxMethodName.Text; string publicOrEn = this.tbxPublicOr.Text; string virtualStringEn = this.tbxVirtual.Text; List <string> ArgsListEn = new List <string>();//this.ParentForm.listArgsInfo.Items foreach (var item in this.listArgsInfo.Items) { string arg = item.ToString(); ArgsListEn.Add(arg); /* * ListViewItem item = new ListViewItem(); * item.Text = arg; * this.ParentForm.listArgsInfo.Items.Add(item); */ } // Japanese string returnTypeJp = this.tbxJpReturnType.Text; string funcnameJp = this.tbxJpMethodName.Text; string publicOrJp = this.tbxJpPublicOr.Text; string virtualStringJp = this.tbxJpVirtual.Text; //this.ParentForm.listJpArgsInfo.Items; List <string> ArgsListJp = new List <string>(); foreach (var item in this.listJpArgsInfo.Items) { string arg = item.ToString(); ArgsListJp.Add(arg); } // convert and save using (DAOContext con = new DAOContext(AccessConstring.jpDBConString)) { con.OpenConnection(); if (!string.IsNullOrEmpty(returnTypeEn.Trim()) && !string.IsNullOrEmpty(returnTypeJp.Trim())) { SettingsSingleton.setValue(con, prefix + returnTypeEn.Trim(), returnTypeJp.Trim()); } if (!string.IsNullOrEmpty(funcnameEn.Trim()) && !string.IsNullOrEmpty(funcnameJp.Trim())) { SettingsSingleton.setValue(con, prefix + funcnameEn.Trim(), funcnameJp.Trim()); } int maxArgEn = ArgsListEn.Count; int maxArgJp = ArgsListJp.Count; int max = (maxArgEn < maxArgJp) ? maxArgEn : maxArgJp; try { for (int i = 0; i < max; i++) { if (!string.IsNullOrEmpty(ArgsListEn[i].Trim()) && !string.IsNullOrEmpty(ArgsListJp[i].Trim())) { SettingsSingleton.setValue(con, prefix + ArgsListEn[i].Trim(), ArgsListJp[i].Trim()); } } } catch (Exception excp) { } con.CloseConnection(); } }
public void Execute(string fullsigunature, string funcname, string returnType, string publicOr, string virtualString, List <string> args) { // prefix string prefix = this.ParentForm.cmbPrefix.Text.Trim(); if (string.IsNullOrEmpty(prefix)) { prefix = string.Empty; } using (DAOContext con = new DAOContext(AccessConstring.jpDBConString)) { con.OpenConnection(); // english this.ParentForm.tbxReturnType.Text = returnType; this.ParentForm.tbxMethodName.Text = funcname; this.ParentForm.tbxPublicOr.Text = publicOr; this.ParentForm.tbxVirtual.Text = virtualString; this.ParentForm.listArgsInfo.Items.Clear(); foreach (string arg in args) { ListViewItem item = new ListViewItem(); item.Text = arg; this.ParentForm.listArgsInfo.Items.Add(item); } // Japanese string ret = string.Empty; SettingsSingleton.getValue(con, prefix + returnType, out ret); if (!string.IsNullOrEmpty(ret)) { this.ParentForm.tbxJpReturnType.Text = ret; } else { this.ParentForm.tbxJpReturnType.Text = returnType; } SettingsSingleton.getValue(con, prefix + funcname, out ret); if (!string.IsNullOrEmpty(ret)) { this.ParentForm.tbxJpMethodName.Text = ret; } else { this.ParentForm.tbxJpMethodName.Text = funcname; } this.ParentForm.tbxJpPublicOr.Text = publicOr; this.ParentForm.tbxJpVirtual.Text = virtualString; this.ParentForm.listJpArgsInfo.Items.Clear(); foreach (string arg in args) { ListViewItem item = new ListViewItem(); SettingsSingleton.getValue(con, prefix + arg, out ret); if (!string.IsNullOrEmpty(ret)) { item.Text = ret; } else { item.Text = arg; } this.ParentForm.listJpArgsInfo.Items.Add(item); } con.CloseConnection(); } }
public void Awake() { instance = this; }
private void Form1_Load(object sender, EventArgs e) { this.cmbReflectTarget.Load(); this.cmbPrefix.SaveFilename = "prefix.txt"; this.cmbPrefix.Load(); this.cmbPublicElse.SelectedIndex = 0; object selected = new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.WindowsForms, "System.Windows.Forms"); this.cmbNameSpace.Items.Add(new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.System, "System")); this.cmbNameSpace.Items.Add(new NameSpaceItem(ReflectOtherAssembly.NameSpaceEnum.Generic, "System.Collections.Generic")); this.cmbNameSpace.Items.Add(selected); this.cmbNameSpace.SelectedItem = selected; this.tbxJpLineOfListBox.ParentListView = this.listJpArgsInfo; this.cmbExportMethod.Text = "TSV"; // Menu /* * //Copy * MenuItem mNdoc = new MenuItem(); * mNdoc.Text = "NDocコメント"; * mNdoc.Click += this.ShowNDocCommentDialog; * //this.cMenu.Items.Add(mNdoc); * this.tbxJpMethodName.ContextMenu = new ContextMenu(); * this.tbxJpMethodName.ContextMenu.MenuItems.Add(mNdoc); */ this.AddMenusToControl(this.tbxJpMethodName); this.AddMenusToControl(this.tbxJpReturnType); this.AddMenusToControl(this.listJpArgsInfo); // SIZE using (DAOContext con = new DAOContext(AccessConstring.SettingConString)) { con.OpenConnection(); int ret = 0; SettingsSingleton.getValue(SettingsSingleton.KeyMainFormTop, out ret); if (ret > 0) { this.Top = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormLeft, out ret); if (ret > 0) { this.Left = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormWidth, out ret); if (ret > 0) { this.Width = ret; } SettingsSingleton.getValue(SettingsSingleton.KeyMainFormHeight, out ret); if (ret > 0) { this.Height = ret; } con.CloseConnection(); } }
//Looks through all of the standard commands public void RunCommand() { SettingsSingleton.Instance().Commands.Find(x => x.GetKeyWord() == commandWord).RunCommand(); }