public TimelineStory() { Opacity = 0; this.InitializeComponent(); Loaded += TimelineStory_Loaded; Loading += TimelineStory_Loading; DateContainer.Fade(duration: 0).StartAsync(); TopLine.Fade(duration: 0).StartAsync(); SummaryContainer.Fade(duration: 0).StartAsync(); LikesContainer.Fade(duration: 0).StartAsync(); ImageContainer.Scale(duration: 0, centerX: (float)ImageContainer.Width / 2, centerY: (float)ImageContainer.Height / 2, scaleX: 0.75f, scaleY: 0.75f).StartAsync(); TitleLine.Scale(duration: 0, scaleX: 0.6f, scaleY: 0.6f) .Offset(offsetX: -30, offsetY: 35, duration: 0) .Fade(0.7f, duration: 0).StartAsync(); }
/// <summary> /// Draw the border using draw event arguments and specified bounding rectangle. /// </summary> /// <param name="e">Draw event arguments.</param> /// <param name="rect">Bounding rectangle.</param> /// <remarks> /// This method is for internal use only. /// </remarks> public void Draw(FRPaintEventArgs e, RectangleF rect) { IGraphics g = e.Graphics; rect.X *= e.ScaleX; rect.Y *= e.ScaleY; rect.Width *= e.ScaleX; rect.Height *= e.ScaleY; if (Shadow) { //int d = (int)Math.Round(ShadowWidth * e.ScaleX); //Pen pen = e.Cache.GetPen(ShadowColor, d, DashStyle.Solid); //g.DrawLine(pen, rect.Right + d / 2, rect.Top + d, rect.Right + d / 2, rect.Bottom); //g.DrawLine(pen, rect.Left + d, rect.Bottom + d / 2, rect.Right + d, rect.Bottom + d / 2); float d = ShadowWidth * e.ScaleX; Brush brush = e.Cache.GetBrush(ShadowColor); g.FillRectangle(brush, rect.Left + d, rect.Bottom, rect.Width, d); g.FillRectangle(brush, rect.Right, rect.Top + d, d, rect.Height); } if (Lines != BorderLines.None) { // draw full frame as a rectangle with solid line only. Non-solid lines // should be drawn separately to avoid overlapping effect if (Lines == BorderLines.All && LeftLine.Equals(TopLine) && LeftLine.Equals(RightLine) && LeftLine.Equals(BottomLine) && LeftLine.Style == LineStyle.Solid) { Pen pen = e.Cache.GetPen(LeftLine.Color, (int)Math.Round(LeftLine.Width * e.ScaleX), LeftLine.DashStyle); g.DrawRectangle(pen, rect.Left, rect.Top, rect.Width, rect.Height); } else { if ((Lines & BorderLines.Left) != 0) { LeftLine.Draw(e, rect.Left, rect.Top, rect.Left, rect.Bottom, true, (Lines & BorderLines.Top) != 0, (Lines & BorderLines.Bottom) != 0); } if ((Lines & BorderLines.Right) != 0) { RightLine.Draw(e, rect.Right, rect.Top, rect.Right, rect.Bottom, false, (Lines & BorderLines.Top) != 0, (Lines & BorderLines.Bottom) != 0); } if ((Lines & BorderLines.Top) != 0) { TopLine.Draw(e, rect.Left, rect.Top, rect.Right, rect.Top, true, (Lines & BorderLines.Left) != 0, (Lines & BorderLines.Right) != 0); } if ((Lines & BorderLines.Bottom) != 0) { BottomLine.Draw(e, rect.Left, rect.Bottom, rect.Right, rect.Bottom, false, (Lines & BorderLines.Left) != 0, (Lines & BorderLines.Right) != 0); } } } }
/// <inheritdoc/> public override bool Equals(object obj) { Border b = obj as Border; return(b != null && Lines == b.Lines && LeftLine.Equals(b.LeftLine) && TopLine.Equals(b.TopLine) && RightLine.Equals(b.RightLine) && BottomLine.Equals(b.BottomLine) && Shadow == b.Shadow && ShadowColor == b.ShadowColor && ShadowWidth == b.ShadowWidth); }
public override void CopyFrom(BindableObject bindableObject) { base.CopyFrom(bindableObject); if (bindableObject is TabButtonStyle tabButtonStyle) { TopLine.CopyFrom(tabButtonStyle.TopLine); BottomLine.CopyFrom(tabButtonStyle.BottomLine); } }
/// <summary> /// Write the fragment with selected text to a string-builder /// </summary> /// <param name="stringBuilder"></param> public override void Write(StringBuilder stringBuilder) { stringBuilder.Append("<br><pre>"); stringBuilder.Append(TopLine.Substring(0, StartCharOffset - 1)); stringBuilder.Append(Text); var substring = BottomLine.Substring(EndCharOffset - 1); stringBuilder.Append(substring); stringBuilder.Append("</pre>"); }
public void AnimateFocus() { DateContainer.Fade(duration: _animationDuration + 300, value: 1, delay: 50).StartAsync(); TopLine.Fade(duration: _animationDuration + 300, value: 1, delay: 50).StartAsync(); SummaryContainer.Fade(duration: _animationDuration + 300, value: 1, delay: 50).StartAsync(); LikesContainer.Fade(duration: _animationDuration + 300, value: 1, delay: 50).StartAsync(); ImageContainer.Scale(duration: _animationDuration, centerX: (float)ImageContainer.Width / 2, centerY: (float)ImageContainer.Height / 2, scaleX: 1.2f, scaleY: 1.2f).StartAsync(); TitleLine.Scale(duration: _animationDuration, scaleX: 1f, scaleY: 1f) .Offset(duration: _animationDuration) .Fade(1f, duration: _animationDuration) .StartAsync(); this.Fade(1, duration: _animationDuration).Start(); }
public void AnimateFocusLost() { DateContainer.Fade(duration: _animationDuration).StartAsync(); TopLine.Fade(duration: _animationDuration).StartAsync(); SummaryContainer.Fade(duration: _animationDuration).StartAsync(); LikesContainer.Fade(duration: _animationDuration).StartAsync(); ImageContainer.Scale(duration: _animationDuration, centerX: (float)ImageContainer.Width / 2, centerY: (float)ImageContainer.Height / 2, scaleX: 0.6f, scaleY: 0.6f).StartAsync(); TitleLine.Scale(duration: _animationDuration, scaleX: 0.6f, scaleY: 0.6f) .Offset(offsetX: -30, offsetY: 35, duration: _animationDuration) .Fade(0.7f, duration: _animationDuration) .StartAsync(); this.Fade(0.7f, duration: _animationDuration).Start(); }
/// <summary> /// Serializes the border. /// </summary> /// <param name="writer">Writer object.</param> /// <param name="prefix">Border property name.</param> /// <param name="c">Another Border to compare with.</param> /// <remarks> /// This method is for internal use only. /// </remarks> public void Serialize(FRWriter writer, string prefix, Border c) { if (Shadow != c.Shadow) { writer.WriteBool(prefix + ".Shadow", Shadow); } if (ShadowWidth != c.ShadowWidth) { writer.WriteFloat(prefix + ".ShadowWidth", ShadowWidth); } if (ShadowColor != c.ShadowColor) { writer.WriteValue(prefix + ".ShadowColor", ShadowColor); } if (!SimpleBorder) { if (Lines != c.Lines) { writer.WriteValue(prefix + ".Lines", Lines); } if (Lines != BorderLines.None || Color != Color.Black) { if (LeftLine.Equals(RightLine) && LeftLine.Equals(TopLine) && LeftLine.Equals(BottomLine) && c.LeftLine.Equals(c.RightLine) && c.LeftLine.Equals(c.TopLine) && c.LeftLine.Equals(c.BottomLine)) { LeftLine.Serialize(writer, prefix, c.LeftLine); } else { LeftLine.Serialize(writer, prefix + ".LeftLine", c.LeftLine); TopLine.Serialize(writer, prefix + ".TopLine", c.TopLine); RightLine.Serialize(writer, prefix + ".RightLine", c.RightLine); BottomLine.Serialize(writer, prefix + ".BottomLine", c.BottomLine); } } } else { LeftLine.Serialize(writer, prefix, c.LeftLine); } }
private int HitTestFrame(Point point) { int result = 0; if (TopLeftGrip.Contains(point)) { result = WM.HTTOPLEFT; } else if (TopRightGrip.Contains(point)) { result = WM.HTTOPRIGHT; } else if (BottomLeftGrip.Contains(point)) { result = WM.HTBOTTOMLEFT; } else if (BottomRightGrip.Contains(point)) { result = WM.HTBOTTOMRIGHT; } else if (TopLine.Contains(point) || TopGrip.Contains(point)) { result = WM.HTTOP; } else if (LeftLine.Contains(point) || LeftGrip.Contains(point)) { result = WM.HTLEFT; } else if (RightLine.Contains(point) || RightGrip.Contains(point)) { result = WM.HTRIGHT; } else if (BottomLine.Contains(point) || (BottomGrip.Contains(point))) { result = WM.HTBOTTOM; } return(result); }
/// <inheritdoc/> public override int GetHashCode() { return(Lines.GetHashCode() ^ (Shadow.GetHashCode() + 16) ^ ShadowColor.GetHashCode() ^ (ShadowWidth.GetHashCode() + 32) ^ (LeftLine.GetHashCode() << 1) ^ (TopLine.GetHashCode() << 2) ^ (RightLine.GetHashCode() << 3) ^ (BottomLine.GetHashCode() << 4)); }
private bool ShouldSerializeTopLine() { return(TopLine.ShouldSerialize()); }
void ReleaseDesignerOutlets() { if (AppointmentDetailsView != null) { AppointmentDetailsView.Dispose(); AppointmentDetailsView = null; } if (AppointmentRequestTime != null) { AppointmentRequestTime.Dispose(); AppointmentRequestTime = null; } if (BottomLine != null) { BottomLine.Dispose(); BottomLine = null; } if (CancelButton != null) { CancelButton.Dispose(); CancelButton = null; } if (CircleView != null) { CircleView.Dispose(); CircleView = null; } if (dateLabel != null) { dateLabel.Dispose(); dateLabel = null; } if (descriptionLabel != null) { descriptionLabel.Dispose(); descriptionLabel = null; } if (StatusImage != null) { StatusImage.Dispose(); StatusImage = null; } if (timeLabel != null) { timeLabel.Dispose(); timeLabel = null; } if (TopLine != null) { TopLine.Dispose(); TopLine = null; } if (VideoCallButton != null) { VideoCallButton.Dispose(); VideoCallButton = null; } }
//Ball colitions private void OnTriggerEnter2D(Collider2D otherCollider) { // Sidelines mySideline = otherCollider.gameObject.GetComponent<Sidelines>();//get the sidelines LeftLine myLeftLine = otherCollider.gameObject.GetComponent <LeftLine>(); //get the sidelines RightLine myRightLine = otherCollider.gameObject.GetComponent <RightLine>(); //get the sidelines TopLine myTopLine = otherCollider.gameObject.GetComponent <TopLine>(); //get the Topline BottomLine myBottomline = otherCollider.gameObject.GetComponent <BottomLine>(); //get the Bottomline PlayerScript myPlayer = otherCollider.gameObject.GetComponent <PlayerScript>(); //get the Player EnemyScript myEnemy = otherCollider.gameObject.GetComponent <EnemyScript>(); //get the STD //if the collliding object is any sideline if (myRightLine != null) { MyAudioManager.BallBounce(); if (STDBallVelocity.x > 0) { STDBallVelocity.x *= -1; } STDBallVelocity = new Vector2(STDBallVelocity.x, STDBallVelocity.y); STDBallRB.velocity = STDBallVelocity; //STDBallSpeedX *= -1; } if (myLeftLine != null) { MyAudioManager.BallBounce(); if (STDBallVelocity.x < 0) { STDBallVelocity.x *= -1; } STDBallVelocity = new Vector2(STDBallVelocity.x, STDBallVelocity.y); STDBallRB.velocity = STDBallVelocity; //STDBallSpeedX *= -1; } //if the collliding object is topline else if (myTopLine != null) { MyAudioManager.BallBounce(); if (STDBallVelocity.y > 0) { STDBallVelocity.y *= -1; } STDBallVelocity = new Vector2(STDBallVelocity.x, STDBallVelocity.y); STDBallRB.velocity = STDBallVelocity; StdPongPlayScript.MyEnemyHealth -= .10f; //reduce the enemy health StdPongPlayScript.intCurrentPlayerScore += 10; //increase player points } //if the collliding object is bottomline else if (myBottomline != null) { MyAudioManager.BallBounce(); if (STDBallVelocity.y < 0) { STDBallVelocity.y *= -1; } STDBallVelocity = new Vector2(STDBallVelocity.x, STDBallVelocity.y); STDBallRB.velocity = STDBallVelocity; StdPongPlayScript.MyPlayerHealth -= .05f; //reduce the player health StdPongPlayScript.intCurrentPlayerScore -= 10; //reduce player points } else if (myPlayer != null) { MyAudioManager.BallBounce(); int RandomDirection = Random.Range(1, 3); int RandomSlantX = Random.Range(5, 8); int RandomSlantY = Random.Range(6, 10); if (RandomDirection == 1) { STDBallVelocity = new Vector2(RandomSlantX * -1f, RandomSlantY * 1f); } else { STDBallVelocity = new Vector2(RandomSlantX * 1f, RandomSlantY * 1f); } STDBallRB.velocity = STDBallVelocity; } else if (myEnemy != null) { MyAudioManager.BallBounce(); int RandomDirection = Random.Range(1, 3); int RandomSlantX = Random.Range(5, 8); int RandomSlantY = Random.Range(6, 10); if (RandomDirection == 1) { STDBallVelocity = new Vector2(RandomSlantX * -1f, RandomSlantY * -1f); } else { STDBallVelocity = new Vector2(RandomSlantX * 1f, RandomSlantY * -1f); } STDBallRB.velocity = STDBallVelocity; } }