コード例 #1
0
        public void RegularChange()
        {
            TestObject[] obj = new TestObject[]
            {
                new TestObject { Foo = 42, Bar = "Hello" },
                new TestObject { Foo = 10, Bar = "World" },
                new TestObject { Foo = 0, Bar = "Not" }
            };
            ObjectPropertyChangedEventArgs args = new ObjectPropertyChangedEventArgs(
                new ObjectSelection(obj.Take(2)),
                new PropertyInfo[] { TestObject.FooProperty });

            Assert.IsTrue(args.HasObject(obj[0]));
            Assert.IsTrue(args.HasObject(obj[1]));
            Assert.IsFalse(args.HasObject(obj[2]));

            Assert.IsTrue(args.HasAnyObject(obj));
            Assert.IsTrue(args.HasAnyObject(obj.Skip(1)));
            Assert.IsFalse(args.HasAnyObject(obj.Skip(2)));

            Assert.IsTrue(args.HasProperty(TestObject.FooProperty));
            Assert.IsFalse(args.HasProperty(TestObject.BarProperty));
            Assert.IsFalse(args.HasProperty(UnrelatedObject.NotProperty));

            Assert.IsTrue(args.HasAnyProperty(TestObject.FooProperty));
            Assert.IsTrue(args.HasAnyProperty(TestObject.FooProperty, TestObject.BarProperty));
            Assert.IsFalse(args.HasAnyProperty(TestObject.BarProperty));
            Assert.IsFalse(args.HasAnyProperty(UnrelatedObject.NotProperty));

            Assert.IsFalse(args.CompleteChange);
        }
コード例 #2
0
ファイル: CamViewState.cs プロジェクト: Scottyaim/duality
		private void DualityEditorApp_ObjectPropertyChanged(object sender, ObjectPropertyChangedEventArgs e)
		{
			if (e.HasAnyProperty(ReflectionInfo.Property_Transform_RelativePos, ReflectionInfo.Property_Transform_RelativeAngle) &&
				e.Objects.Components.Any(c => c.GameObj == this.CameraObj))
			{
				if (!this.camBeginDragScene) this.OnMouseMove();
			}
		}