/// <summary> /// Returns the HashCode for this Matrix3D /// </summary> /// <returns> /// int - the HashCode for this Matrix3D /// </returns> public override int GetHashCode() { if (IsDistinguishedIdentity) { return(c_identityHashCode); } else { // Perform field-by-field XOR of HashCodes return(M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^ M14.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^ M24.GetHashCode() ^ M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode() ^ M34.GetHashCode() ^ OffsetX.GetHashCode() ^ OffsetY.GetHashCode() ^ OffsetZ.GetHashCode() ^ M44.GetHashCode()); } }
protected override void Execute(NativeActivityContext context) { var relativelement = Element.Get(context); var match = relativelement.Rectangle; match.X += OffsetX.Get(context); match.Y += OffsetY.Get(context); match.Width = Width.Get(context); match.Height = Height.Get(context); var processname = relativelement.Processname; if (!string.IsNullOrEmpty(processname)) { var _element = AutomationHelper.GetFromPoint(match.X, match.Y); if (_element.ProcessId < 1) { throw new ElementNotFoundException("Failed locating Image, expected " + processname + " but found nothing"); } var p = System.Diagnostics.Process.GetProcessById(_element.ProcessId); if (p.ProcessName != processname) { throw new ElementNotFoundException("Failed locating Image, expected " + processname + " but found " + p.ProcessName); } } var b = Interfaces.Image.Util.Screenshot(match); //Interfaces.Image.Util.SaveImageStamped(b, "c:\\temp", "GetImage-result"); var v = new ImageElement(match, b); context.SetValue(Result, v); context.ScheduleAction(Body, v, OnBodyComplete); }
protected void Initialize(CodeActivityContext context) { doc = Document.Get(context); rec = Signer.Get(context); if (rec.RecipientType != "Signer") { throw new ArgumentException("Only Signers can have tabs added to them, not other Recipient types"); } sigX = PositionX.Get(context); sigY = PositionY.Get(context); anchorText = AnchorText.Get(context); offsetX = OffsetX.Get(context); offsetY = OffsetY.Get(context); tabLabel = TabLabel.Get(context); toolTip = ToolTip.Get(context); pageNumber = PageNumber.Get(context); if (anchorText != null && anchorText != "" && Path.GetExtension(doc.filename) != ".pdf") { throw new FormatException("Can only use relative positioning on .pdf files"); } }
/// <summary> /// Helper to load Settings and populate the form elements /// <see cref="Settings"/> /// </summary> public void LoadSettings() { // line LineThickness = Settings.LineThickness; tB_LineThickness.Text = LineThickness.ToString(); LineMaxLength = Settings.LineMaxLength; tB_LineMaxLength.Text = LineMaxLength.ToString(); LineDividerLengthFactor = Settings.LineSubdividerLengthFactor; tB_LineDividerLengthFactor.Text = LineDividerLengthFactor.ToString(); ScaleStyle = Settings.Style; lB_ScaleStyle.DataStore = Enum.GetNames(typeof(ScaleOverlay.ScaleStyle)); // text TextHeight = Settings.TextHeight; tB_TextHeight.Text = TextHeight.ToString(); TextFont = Settings.TextFont; fP_TextFont.Value = TextFont.ToEtoFont(); // position OffsetX = Settings.OffsetX; tB_OffsetX.Text = OffsetX.ToString(); OffsetY = Settings.OffsetY; tB_OffsetY.Text = OffsetY.ToString(); TextGap = Settings.TextGap; tB_TextGap.Text = TextGap.ToString(); // color LineColor = Settings.LineColor; btn_LineColor.BackgroundColor = LineColor.ToEto(); TextColor = Settings.TextColor; btn_TextColor.BackgroundColor = TextColor.ToEto(); }
public override string[] ToStringArray() { string[] a = new string[13]; a[0] = ID.ToString(); a[1] = GameType.ToString(); a[2] = Type.ToString(); a[3] = SubType.ToString(); a[4] = Group.ToString(); a[5] = TargetGroup.ToString(); /*a[5] = Bytes[6].ToString(); * a[6] = Bytes[7].ToString(); * a[7] = Bytes[8].ToString(); * a[8] = Bytes[9].ToString(); * a[9] = Bytes[10].ToString(); * a[10] = Bytes[11].ToString();*/ a[6] = NextID.ToString(); a[7] = Value.ToString();// Bytes[14].ToString(); //a[7] = Bytes[15].ToString(); a[8] = X.ToString(); a[9] = Y.ToString(); a[10] = OffsetX.ToString(); a[11] = OffsetY.ToString(); a[12] = Offset.ToString(); return(a); }
protected override void Execute(CodeActivityContext context) { var el = Element.Get(context); if (el == null) { throw new ArgumentException("element cannot be null"); } var doubleclick = false; if (DoubleClick != null) { doubleclick = DoubleClick.Get(context); } var button = Button.Get(context); var virtualClick = false; if (VirtualClick != null) { virtualClick = VirtualClick.Get(context); } var animatemouse = false; if (AnimateMouse != null) { animatemouse = AnimateMouse.Get(context); } var keymodifiers = ""; if (KeyModifiers != null) { keymodifiers = KeyModifiers.Get(context); } var disposes = new List <IDisposable>(); var keys = TypeText.GetKeys(keymodifiers); foreach (var vk in keys) { disposes.Add(FlaUI.Core.Input.Keyboard.Pressing(vk)); } var _button = (Input.MouseButton)button; el.Click(virtualClick, _button, OffsetX.Get(context), OffsetY.Get(context), doubleclick, animatemouse); TimeSpan postwait = TimeSpan.Zero; if (PostWait != null) { postwait = PostWait.Get(context); } if (postwait != TimeSpan.Zero) { System.Threading.Thread.Sleep(postwait); // FlaUI.Core.Input.Wait.UntilInputIsProcessed(); } disposes.ForEach(x => { x.Dispose(); }); }
public override int GetHashCode() { // Perform field-by-field XOR of HashCodes return(M11.GetHashCode() ^ M12.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ OffsetX.GetHashCode() ^ OffsetY.GetHashCode()); }
/// <inheritdoc/> public override Int32 GetHashCode() { unchecked { var hash = 17; hash = hash * 23 + GlyphIndex.GetHashCode(); hash = hash * 23 + OffsetX.GetHashCode(); hash = hash * 23 + OffsetY.GetHashCode(); hash = hash * 23 + Advance.GetHashCode(); return(hash); } }
protected override void Execute(CodeActivityContext context) { var el = Element.Get(context); // if (el == null) throw new ArgumentException("element cannot be null"); var x = OffsetX.Get(context); var y = OffsetY.Get(context); if (el != null) { x += el.Rectangle.X; y += el.Rectangle.Y; } Result.Set(context, GetPixelColor(x, y)); }
private void tB_OffsetY_TextChanged(object sender, EventArgs e) { if (int.TryParse(tB_OffsetY.Text, out int result)) { OffsetY = result; if (result < Settings.MinOffsetY) { OffsetY = Settings.MinOffsetY; } if (result > Settings.MaxOffsetY) { OffsetY = Settings.MaxOffsetY; } tB_OffsetY.Text = OffsetY.ToString(); } }
public void Init(GameStage stage, GamePlayer player) { StageNumber.text = stage.Stage.ToString(); for (int lcv = 0, length = stage.LEDStyleWeights.Length; lcv < length; lcv++) { var styleWeight = stage.LEDStyleWeights[lcv]; var weight = styleWeight.Weight == 0 ? 1 : styleWeight.Weight; // we treat weight zero as 1, for now switch (styleWeight.GraphType) { case LEDRendering.GraphType.Horizontal: H.gameObject.SetActive(true); H.SetTransparency(weight); break; case LEDRendering.GraphType.Vertical: V.gameObject.SetActive(true); V.SetTransparency(weight); break; case LEDRendering.GraphType.DiagonalX: D.gameObject.SetActive(true); D.SetTransparency(weight); break; } } if (stage.InvertXWeight > 0) { FlipX.gameObject.SetActive(true); FlipX.SetTransparency(stage.InvertXWeight); } if (stage.InvertYWeight > 0) { FlipY.gameObject.SetActive(true); FlipY.SetTransparency(stage.InvertYWeight); } if (stage.StartXWeight > 0) { OffsetX.gameObject.SetActive(true); OffsetX.SetTransparency(stage.StartXWeight); } if (stage.StartYWeight > 0) { OffsetY.gameObject.SetActive(true); OffsetY.SetTransparency(stage.StartYWeight); } UpdateStage(stage, player); }
public override int GetHashCode() { // Perform field-by-field XOR of HashCodes return(M11.GetHashCode() ^ M12.GetHashCode() ^ M13.GetHashCode() ^ M14.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ M23.GetHashCode() ^ M24.GetHashCode() ^ M31.GetHashCode() ^ M32.GetHashCode() ^ M33.GetHashCode() ^ M34.GetHashCode() ^ OffsetX.GetHashCode() ^ OffsetY.GetHashCode() ^ OffsetZ.GetHashCode() ^ M44.GetHashCode()); }
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state) { recipientName = RecipientName.Get(context); recipientEmail = RecipientEmail.Get(context); subject = Subject.Get(context); documentFilePath = DocumentFilePath.Get(context); sigX = PositionX.Get(context); sigY = PositionY.Get(context); anchorText = AnchorText.Get(context); offsetX = OffsetX.Get(context); offsetY = OffsetY.Get(context); if (anchorText != null && anchorText != "" && Path.GetExtension(documentFilePath) != ".pdf") { throw new FormatException("Can only use relative positioning on .pdf files"); } LoadAuthentication(context); SendEnvelopeDelegate = new Action(SendEnvelope); return(SendEnvelopeDelegate.BeginInvoke(callback, state)); }
protected override void Execute(CodeActivityContext context) { var el = Element.Get(context); var animatemouse = false; if (AnimateMouse != null) { animatemouse = AnimateMouse.Get(context); } var button = -1; if (Button != null) { button = Button.Get(context); } var x = OffsetX.Get(context); var y = OffsetY.Get(context); if (el != null) { x += el.Rectangle.X; y += el.Rectangle.Y; } if (button > -1) { if (button == 1) // MouseButton.Left { NativeMethods.mouse_event(NativeMethods.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); } else if (button == 1) // MouseButton.Right { NativeMethods.mouse_event(NativeMethods.MOUSEEVENTF_RIGHTDOWN, 0, 0, 0, 0); } } if (animatemouse) { FlaUI.Core.Input.Mouse.MoveTo(new System.Drawing.Point(x, y)); } else { NativeMethods.SetCursorPos(x, y); } if (button > -1) { if (button == 1) // MouseButton.Left { NativeMethods.mouse_event(NativeMethods.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); } else if (button == 1) // MouseButton.Right { NativeMethods.mouse_event(NativeMethods.MOUSEEVENTF_RIGHTUP, 0, 0, 0, 0); } } TimeSpan postwait = TimeSpan.Zero; if (PostWait != null) { postwait = PostWait.Get(context); } if (postwait != TimeSpan.Zero) { System.Threading.Thread.Sleep(postwait); } }
public override int GetHashCode() { return(M11.GetHashCode() ^ M12.GetHashCode() ^ M21.GetHashCode() ^ M22.GetHashCode() ^ OffsetX.GetHashCode() ^ OffsetY.GetHashCode()); }