public void HookupTriggers() { afterLayout.SetOutput(AllWindowsLayout.GetCurrentLayout()); WindowHooks.WinEventDelegate windowMovedDelegate = new(WindowMoved); _gcSafetyHandle = GCHandle.Alloc(windowMovedDelegate); _hook = WindowHooks.WinEventHookOne(NativeMethods.SWEH_Events.EVENT_SYSTEM_MOVESIZEEND, windowMovedDelegate, 0, 0); _hook2 = WindowHooks.WinEventHookOne(NativeMethods.SWEH_Events.EVENT_OBJECT_FOCUS, windowMovedDelegate, 0, 0); WindowHooks.WindowArrangementManuallyChanged += ArrangementChanged; }
public void Evaluate() { object testValueToRound = _valueToRound[INodeField.InputKey]; double valueToRound = (double)testValueToRound; double roundValueField = _roundValueField.GetInput <double>(); double integerRoundingValue = valueToRound / roundValueField; switch (_roundingMethod["display"]) { case RoundingMethod.Closest: case 0: integerRoundingValue = Math.Round(integerRoundingValue); break; case RoundingMethod.Up: case 1: integerRoundingValue = Math.Round(integerRoundingValue, MidpointRounding.ToPositiveInfinity); break; case RoundingMethod.Down: case 2: integerRoundingValue = Math.Round(integerRoundingValue, MidpointRounding.ToNegativeInfinity); break; } _roundedValue.SetOutput(integerRoundingValue * _roundValueField.GetInput <double>()); }
public void Evaluate() { Point currentPos = WindowHooks.CurrentCursorPosition(); _XField.SetOutput(Convert.ToDouble(currentPos.X)); _YField.SetOutput(Convert.ToDouble(currentPos.Y)); }
private void WindowMovedMethod(IntPtr hWndEventHook, NativeMethods.SWEH_Events eventType, IntPtr hWnd, NativeMethods.SWEH_ObjectId objID, long idChild, uint dwEventThread, uint dwmsEventTime) { Debug.WriteLine("A window has been moved"); movedWindow.SetOutput(new Window.Window { hWnd = hWnd }); Trigger?.Invoke(this, new EventArgs()); }
public void Evaluate() { Rectangle monitorSize = WindowHooks.CurrentMonitorSize(); _topField.SetOutput((double)monitorSize.Rect.Top); _leftField.SetOutput((double)monitorSize.Rect.Left); _widthField.SetOutput((double)monitorSize.Rect.Right - monitorSize.Rect.Left); _heightField.SetOutput((double)monitorSize.Rect.Bottom - monitorSize.Rect.Top); }
public void Evaluate() { double total = 0; foreach (INodeField field in addFields) { total += field.GetInput <double>(); } totalField.SetOutput(total); }
public void Evaluate() { string output = string.Empty; foreach (INodeField field in combineStrings) { output += field.GetInput <string>(); } combinedString.SetOutput(output); }
public void Evaluate() { double output = 1.0; foreach (INodeField field in multiplyFields) { output *= field.GetInput <double>(); } outputField.SetOutput(output); }
public void Evaluate() { _outputField.SetOutput(new Rectangle { Rect = new RECT { Left = (int)_leftField.GetInput <double>(), Top = (int)_topField.GetInput <double>(), Right = (int)_leftField.GetInput <double>() + (int)_widthField.GetInput <double>(), Bottom = (int)_topField.GetInput <double>() + (int)_heightField.GetInput <double>(), } }); }
public void Evaluate() { converterField.SetOutput(converterField.GetInput() == null ? string.Empty : converterField.GetInput().ToString()); }
private void ArrangementChanged() { beforeLayout.SetOutput(afterLayout.GetOutput()); afterLayout.SetOutput(AllWindowsLayout.GetCurrentLayout()); }
public void Evaluate() { outputField.SetOutput(firstNumber.GetInput <double>() - secondNumber.GetInput <double>()); }
public void Evaluate() { counterField.SetOutput(Convert.ToDouble(counterField.GetInput <string>().Length)); }
public void Evaluate() { outputField.SetOutput(inputOne.GetInput().Equals(inputTwo.GetInput())); }
public void Evaluate() { outputField.SetOutput(Math.Sin(inputField.GetInput <double>())); }