当前位置: 首页>>代码示例>>C#>>正文


C# Rect.Equals方法代码示例

本文整理汇总了C#中System.Windows.Rect.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Rect.Equals方法的具体用法?C# Rect.Equals怎么用?C# Rect.Equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Rect的用法示例。


在下文中一共展示了Rect.Equals方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoesntContain

 protected virtual bool DoesntContain(Rect rect, double otherStart, double otherEnd)
 {
     if (rect.Equals(Rect.Empty)) return true;
     double center = (otherStart + otherEnd)/2;
     if (center.IsInvalid()) return true;
     return center < start || center > end;
 }
开发者ID:hsteinhilber,项目名称:white-project,代码行数:7,代码来源:Span.cs

示例2: AnimateActiveAreaRectTo

		internal void AnimateActiveAreaRectTo(Rect newRect)
		{
			if (newRect.Equals(currentAnimateActiveAreaRectToTarget))
				return;
			activeAreaGeometry.BeginAnimation(
				RectangleGeometry.RectProperty,
				new RectAnimation(newRect, new Duration(new TimeSpan(0,0,0,0,100))),
				HandoffBehavior.SnapshotAndReplace);
			currentAnimateActiveAreaRectToTarget = newRect;
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:10,代码来源:InfoTextEnterArea.cs

示例3: Equals

		public void Equals ()
		{
			Rect r1 = new Rect (1, 2, 3, 4);
			Rect r2 = r1;

			Assert.IsTrue (r1.Equals (r1));

			r2.X = 0;
			Assert.IsFalse (r1.Equals (r2));
			r2.X = r1.X;

			r2.Y = 0;
			Assert.IsFalse (r1.Equals (r2));
			r2.Y = r1.Y;

			r2.Width = 0;
			Assert.IsFalse (r1.Equals (r2));
			r2.Width = r1.Width;

			r2.Height = 0;
			Assert.IsFalse (r1.Equals (r2));
			r2.Height = r1.Height;

			Assert.IsFalse (r1.Equals (new object ()));

			r1 = Rect.Empty;
			r2 = Rect.Empty;

			Assert.AreEqual (true, r1.Equals (r2));
			Assert.AreEqual (true, r2.Equals (r1));
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:31,代码来源:RectTest.cs

示例4: Equals

 public static bool Equals(Rect rect1, Rect rect2)
 {
     return rect1.Equals (rect2);
 }
开发者ID:shahid-pk,项目名称:MonoPresentationFoundation,代码行数:4,代码来源:Rect.cs

示例5: ShowPopup

        private void ShowPopup(PopupData popupData, UIElement element, Rect startRect, Rect endRect, double startOpacity, double endOpacity, double animationDuration, Action onClosed, IEnumerable<AnimationInfo> animations = null)
        {
            if (popupData.Element != null)
            ClosePopup(popupData, popupData.Element, true);

              var sizedElement = new SizedElement(element, new Size(startRect.Width, startRect.Height)) { Opacity = startOpacity };
              Popup popup = popupData.Popup;
              popup.Child = sizedElement;
              popup.HorizontalOffset = startRect.X;
              popup.VerticalOffset = startRect.Y;
              popup.Width = startRect.Width;
              popup.Height = startRect.Height;
              popupData.Element = element;
              popupData.OnPopupClosed = onClosed;
              popup.IsOpen = true;
              popupData.InitialBackgroundState = myCurrentBackgroundState;

              if (!endRect.Equals(startRect))
              {
            var xAnimation = new AnimationInfo(popup, new PropertyPath(Popup.HorizontalOffsetProperty), startRect.X, endRect.X);
            var yAnimation = new AnimationInfo(popup, new PropertyPath(Popup.VerticalOffsetProperty), startRect.Y, endRect.Y);
            var widthAnimation = new AnimationInfo(sizedElement, new PropertyPath(SizedElement.WidthProperty), startRect.Width, endRect.Width);
            var heightAnimation = new AnimationInfo(sizedElement, new PropertyPath(SizedElement.HeightProperty), startRect.Height, endRect.Height);
            var additionalAnimations = new[] {xAnimation, yAnimation, widthAnimation, heightAnimation};
            animations = animations != null ? animations.Concat(additionalAnimations) : additionalAnimations;
              }

              popupData.AnimationsOnClose = animations != null ? (ICollection<AnimationInfo>)animations.Select(info => info.Reverse()).ToList() : new AnimationInfo[0];

              AnimatePopup(sizedElement, animationDuration, endOpacity, Math.Min(myCurrentBackgroundState.Opacity, 0.7), 5, animations);
        }
开发者ID:valentinkip,项目名称:Test,代码行数:31,代码来源:UIManagerImpl.xaml.cs

示例6: WriteAttribute

 /// <summary>
 /// Writes the attribute.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="value">The value.</param>
 /// <param name="defaultValue">The default value.</param>
 protected void WriteAttribute(string name, Rect value, Rect defaultValue)
 {
     if (this.settings.WriteDefaultValues || !value.Equals(defaultValue)) {
         this.writer.WriteAttributeString(name, value.Format());
     }
 }
开发者ID:modulexcite,项目名称:SilverlightWpfContrib,代码行数:12,代码来源:XamlWriter.cs

示例7: EqualsNaN

		public void EqualsNaN ()
		{
			Rect r = new Rect (Double.NaN, Double.NaN, Double.NaN, Double.NaN);
			Assert.IsFalse (r.Equals (r), "Equals(Rect)");
			Assert.IsFalse (r.Equals ((object)r), "Equals(object)");
		}
开发者ID:kangaroo,项目名称:moon,代码行数:6,代码来源:RectTest.cs


注:本文中的System.Windows.Rect.Equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。