protected override void Execute(CodeActivityContext context) { AndroidDriver <AndroidElement> driver; // Inherit driver from scope activity OR from input (if out of context) try { driver = context.DataContext.GetProperties()["Driver"].GetValue(context.DataContext) as AndroidDriver <AndroidElement>; } catch { driver = Driver.Get(context); } // Receive fields int startx = StartX.Get(context); int starty = StartY.Get(context); int endx = EndX.Get(context); int endy = EndY.Get(context); int delay = Delay.Get(context); // Apply delay Thread.Sleep(delay); // Tap on the element new TouchAction(driver).Press(startx, starty).Wait(300).MoveTo(endx, endy).Release().Perform(); }
public Vector3 GetStart(float frame) { return(new Vector3( StartX.GetFrameValue(frame), StartY.GetFrameValue(frame), StartZ.GetFrameValue(frame))); }
public override void Save(XmlTextWriter writer) { writer.WriteStartElement("Autoscroll"); writer.WriteAttributeString("speed", Speed.ToString()); writer.WriteAttributeString("startX", StartX.ToString()); writer.WriteEndElement(); }
public override double GetValue(double x) { double startX = StartX.GetValue(x); double startY = StartY.GetValue(x); double endX = EndX.GetValue(x); double endY = EndY.GetValue(x); if (x < startX) { // This makes it "flatline": x = startX; } else if (x > endX) { // This makes it "flatline": x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } // Read there: double y = SourceModule.GetValue(x); if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Return y: return(y); }
public override UnityEngine.Color GetColour(double x, double y) { double startX = StartX.GetValue(x, y); double startY = StartY.GetValue(x, y); double endX = EndX.GetValue(x, y); double endY = EndY.GetValue(x, y); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetColour(x, y)); }
public override double GetWrapped(double x, double y, int wrap) { double startX = StartX.GetWrapped(x, y, wrap); double startY = StartY.GetWrapped(x, y, wrap); double endX = EndX.GetWrapped(x, y, wrap); double endY = EndY.GetWrapped(x, y, wrap); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } // Read there: return(SourceModule.GetWrapped(x, y, wrap)); }
/// <summary> /// convert the datatable to an XML document /// </summary> /// <param name="oNode"></param> /// <param name="y"></param> private void BuildTree(XmlNode oNode, int y) { XmlNode childNode = null; //has children foreach (TreeData.TreeDataTableRow childRow in dtTree.Select( string.Format("parentNodeID='{0}'", oNode.Attributes["nodeID"].InnerText))) { //for each child node call this function again childNode = GetXMLNode(childRow.nodeID, childRow.nodeDescription, childRow.nodeNote); oNode.AppendChild(childNode); BuildTree(childNode, y + 1); } //build node data //after checking for nodes we can add the current node int StartX; int StartY; int[] ResultsArr = new int[] { GetXPosByOwnChildren(oNode), GetXPosByParentPreviousSibling(oNode), GetXPosByPreviousSibling(oNode), _Margin }; Array.Sort(ResultsArr); StartX = ResultsArr[3]; StartY = (y * (_BoxHeight + _VerticalSpace)) + _Margin; int width = _BoxWidth; int height = _BoxHeight; //update the coordinates of this box into the matrix, for later calculations oNode.Attributes["X"].InnerText = StartX.ToString(); oNode.Attributes["Y"].InnerText = StartY.ToString(); //update the image size if (imgWidth < (StartX + width + _Margin)) { imgWidth = StartX + width + _Margin; } if (imgHeight < (StartY + height + _Margin)) { imgHeight = StartY + height + _Margin; } }
/// <summary> /// Gets the path representing this element. /// </summary> public override VectorPath GetPath(SVGElement context, RenderContext renderer) { Css.RenderableData rd = context.RenderData; if (_Path == null) { _Path = new VectorPath(); float startX = StartX.GetDecimal(rd, ViewportAxis.X); float startY = StartY.GetDecimal(rd, ViewportAxis.Y); float endX = EndX.GetDecimal(rd, ViewportAxis.X); float endY = EndY.GetDecimal(rd, ViewportAxis.Y); _Path.MoveTo(startX, startY); _Path.LineTo(endX, endY); } return(_Path); }
public override double GetValue(double x, double y, double z) { double startX = StartX.GetValue(x, y, z); double startY = StartY.GetValue(x, y, z); double startZ = StartY.GetValue(x, y, z); double endX = EndX.GetValue(x, y, z); double endY = EndY.GetValue(x, y, z); double endZ = EndY.GetValue(x, y, z); if (x < startX) { // This makes it clamp: x = startX; } else if (x > endX) { // This makes it clamp: x = endX; } else { // Box x: x = (x - startX) / (endX - startX); } if (y < startY) { // This makes it "flatline": y = startY; } else if (y > endY) { // This makes it "flatline": y = endY; } else { // Box y: y = (y - startY) / (endY - startY); } if (z < startZ) { // This makes it "flatline": z = startZ; } else if (z > endZ) { // This makes it "flatline": z = endZ; } else { // Box z: z = (z - startZ) / (endZ - startZ); } // Read there: return(SourceModule.GetValue(x, y, z)); }
public void Read(AssetReader reader) { DeltaPose.Read(reader); StartX.Read(reader); if (IsReadStopX(reader.Version)) { StopX.Read(reader); } LeftFootStartX.Read(reader); RightFootStartX.Read(reader); if (IsReadMotion(reader.Version)) { MotionStartX.Read(reader); MotionStopX.Read(reader); } if (IsVector3(reader.Version)) { AverageSpeed.Read3(reader); } else { AverageSpeed.Read(reader); } Clip.Read(reader); StartTime = reader.ReadSingle(); StopTime = reader.ReadSingle(); OrientationOffsetY = reader.ReadSingle(); Level = reader.ReadSingle(); CycleOffset = reader.ReadSingle(); AverageAngularSpeed = reader.ReadSingle(); m_indexArray = reader.ReadInt32Array(); if (IsReadAdditionalCurveIndexArray(reader.Version)) { m_additionalCurveIndexArray = reader.ReadInt32Array(); } m_valueArrayDelta = reader.ReadArray <ValueDelta>(); if (IsReadValueArrayReferencePose(reader.Version)) { m_valueArrayReferencePose = reader.ReadSingleArray(); } Mirror = reader.ReadBoolean(); if (IsReadLoopTime(reader.Version)) { LoopTime = reader.ReadBoolean(); } LoopBlend = reader.ReadBoolean(); LoopBlendOrientation = reader.ReadBoolean(); LoopBlendPositionY = reader.ReadBoolean(); LoopBlendPositionXZ = reader.ReadBoolean(); if (IsReadStartAtOrigin(reader.Version)) { StartAtOrigin = reader.ReadBoolean(); } KeepOriginalOrientation = reader.ReadBoolean(); KeepOriginalPositionY = reader.ReadBoolean(); KeepOriginalPositionXZ = reader.ReadBoolean(); HeightFromFeet = reader.ReadBoolean(); reader.AlignStream(AlignType.Align4); }
public void Read(EndianStream stream) { DeltaPose.Read(stream); StartX.Read(stream); if (IsReadStopX) { StopX.Read(stream); } LeftFootStartX.Read(stream); RightFootStartX.Read(stream); if (IsReadMotion) { MotionStartX.Read(stream); MotionStopX.Read(stream); } if (IsVector3) { AverageSpeed3.Read(stream); } else { AverageSpeed4.Read(stream); } Clip.Read(stream); StartTime = stream.ReadSingle(); StopTime = stream.ReadSingle(); OrientationOffsetY = stream.ReadSingle(); Level = stream.ReadSingle(); CycleOffset = stream.ReadSingle(); AverageAngularSpeed = stream.ReadSingle(); m_indexArray = stream.ReadInt32Array(); m_valueArrayDelta = stream.ReadArray <ValueDelta>(); if (IsReadValueArrayReferencePose) { m_valueArrayReferencePose = stream.ReadSingleArray(); } Mirror = stream.ReadBoolean(); LoopTime = stream.ReadBoolean(); LoopBlend = stream.ReadBoolean(); LoopBlendOrientation = stream.ReadBoolean(); LoopBlendPositionY = stream.ReadBoolean(); LoopBlendPositionXZ = stream.ReadBoolean(); if (IsReadStartAtOrigin) { StartAtOrigin = stream.ReadBoolean(); } KeepOriginalOrientation = stream.ReadBoolean(); KeepOriginalPositionY = stream.ReadBoolean(); KeepOriginalPositionXZ = stream.ReadBoolean(); HeightFromFeet = stream.ReadBoolean(); stream.AlignStream(AlignType.Align4); }
get => new Point(StartX, StartY);
/// <summary> /// Generates a unique hashcode based on the properties /// of this object. /// </summary> /// <returns>Generated hashcode.</returns> public override int GetHashCode() { return(StartY.GetHashCode() | StartX.GetHashCode() | Height.GetHashCode() | Width.GetHashCode()); }
get => new Vector3(StartX, StartY, StartZ);