DrawingAttributes.Inequality(DrawingAttributes, DrawingAttributes) 运算符
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
确定指定的 DrawingAttributes 对象是否不相等。
public:
static bool operator !=(System::Windows::Ink::DrawingAttributes ^ first, System::Windows::Ink::DrawingAttributes ^ second);
public static bool operator != (System.Windows.Ink.DrawingAttributes first, System.Windows.Ink.DrawingAttributes second);
static member op_Inequality : System.Windows.Ink.DrawingAttributes * System.Windows.Ink.DrawingAttributes -> bool
Public Shared Operator != (first As DrawingAttributes, second As DrawingAttributes) As Boolean
参数
- first
- DrawingAttributes
要比较的第一个 DrawingAttributes 对象。
- second
- DrawingAttributes
要比较的第二个 DrawingAttributes 对象。
返回
如果对象不相等,则为 true
;否则为 false
。
示例
以下示例比较两 DrawingAttributes 个对象不相等。 由于 Height上的Color属性StylusTip和attributes2
Width属性attributes1
设置为相同的值,因此将显示“DrawingAttributes 等于”消息。
DrawingAttributes attributes1 = new DrawingAttributes();
attributes1.Color = Colors.Blue;
attributes1.StylusTip = StylusTip.Rectangle;
attributes1.Height = 5;
attributes1.Width = 5;
DrawingAttributes attributes2 = new DrawingAttributes();
attributes2.Color = Colors.Blue;
attributes2.StylusTip = StylusTip.Rectangle;
attributes2.Height = 5;
attributes2.Width = 5;
Dim attributes1 As New DrawingAttributes()
attributes1.Color = Colors.Blue
attributes1.StylusTip = StylusTip.Rectangle
attributes1.Height = 5
attributes1.Width = 5
Dim attributes2 As New DrawingAttributes()
attributes2.Color = Colors.Blue
attributes2.StylusTip = StylusTip.Rectangle
attributes2.Height = 5
attributes2.Width = 5
if (attributes1 != attributes2)
{
MessageBox.Show("The DrawingAttributes are not equal");
}
else
{
MessageBox.Show("The DrawingAttributes are equal");
}
If attributes1 <> attributes2 Then
MessageBox.Show("The DrawingAttributes are not equal")
Else
MessageBox.Show("The DrawingAttributes are equal")
End If
注解
如果以下属性不相等,则两 DrawingAttributes 个对象不相等:
备注
该方法 Inequality 不检查自定义属性是否相等。
此运算符的等效方法是否定 DrawingAttributes.Equals。