diff --git a/Microsoft.DotNet.Wpf.Test.sln b/Microsoft.DotNet.Wpf.Test.sln
index 889fce278..e7d9ffa21 100644
--- a/Microsoft.DotNet.Wpf.Test.sln
+++ b/Microsoft.DotNet.Wpf.Test.sln
@@ -367,6 +367,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementLayoutData", "src\Te
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementLayoutTestPart1", "src\Test\ElementLayout\FeatureTests\Part1\ElementLayoutTestPart1.csproj", "{4A3C635A-23B8-4440-8000-AAFA3B83997D}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementServicesTest", "src\Test\ElementServices\FeatureTests\BuildSources\ElementServicesTest.csproj", "{8E9541C8-C7FB-4D27-B2F4-9C47F475F6E9}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreTestsTrusted", "src\Test\ElementServices\FeatureTests\Trusted\CoreTestsTrusted.csproj", "{1A7495C0-26CF-4FD7-8D16-7773CDA46B93}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreTestsUntrusted", "src\Test\ElementServices\FeatureTests\Untrusted\CoreTestsUntrusted.csproj", "{C9B8F473-0F60-4E3D-B3A2-D30A5D36704E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElementServicesData", "src\Test\ElementServices\FeatureTests\TestData\ElementServicesData.csproj", "{2C04C254-08CD-4267-9C5A-D0AD6090C948}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WpfApp", "src\Test\ElementServices\FeatureTests\ControllerApplications\WpfApp\WpfApp.csproj", "{0C0165BA-0B4B-4F2E-A5D8-A281F51E5739}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreezablesTest", "src\Test\ElementServices\FeatureTests\Freezables\BuildSources\FreezablesTest.csproj", "{80929AB1-8C35-452A-B995-3D6D28502BF3}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiTouchTestCommon", "src\Test\ElementServices\FeatureTests\Part1\Common\MultiTouchTestCommon.csproj", "{56170610-87BA-4922-AF06-60FB1F5D70A9}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MultiTouchTest", "src\Test\ElementServices\FeatureTests\Part1\multitouch\MultiTouchTest.csproj", "{7D7B24E7-C3ED-4E38-99D1-2859B7805055}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Part1CommonData", "src\Test\ElementServices\FeatureTests\Part1\Common\Part1CommonData.csproj", "{1073D625-B196-4883-BC36-6CBA357B173C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index ea7f34985..6db47c493 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -17,7 +17,7 @@
- $(NoWarn);SYSLIB0021;SYSLIB0024;SYSLIB0018;SYSLIB0044
+ $(NoWarn);SYSLIB0021;SYSLIB0024;SYSLIB0018;SYSLIB0044;SYSLIB0050
diff --git a/src/Test/BranchCommon/data/DiscoveryInfo.xml b/src/Test/BranchCommon/data/DiscoveryInfo.xml
index d2da2dfed..eb4f07435 100644
--- a/src/Test/BranchCommon/data/DiscoveryInfo.xml
+++ b/src/Test/BranchCommon/data/DiscoveryInfo.xml
@@ -484,5 +484,151 @@
+
+
+
+ ElementServices
+
+
+
+
+
+
+
+
+
+
+ FeatureTests\ElementServices\ElementServicesTest.deployment
+
+
+ 3.0+
+ 4.0Client+
+
+
+
+
+
+
+
+
+
+
+
+ 3.0+
+ 4.0Client+
+
+
+
+
+
+
+ ElementServices
+
+
+
+
+
+
+
+
+
+
+ FeatureTests\ElementServices\ElementServicesTest.deployment
+
+
+ 3.0+
+ 4.0Client+
+
+
+
+
+
+
+
+ Infra\Configurations\Multitouch_Win7_Forward.xml
+
+
+
+
+
+
+
+
+
+
+
+
+
+ FeatureTests\ElementServices\MultiTouchTest.deployment
+
+
+ 4.0+
+ 4.0Client+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/BuildSources/ElementServicesTest.csproj b/src/Test/ElementServices/FeatureTests/BuildSources/ElementServicesTest.csproj
new file mode 100644
index 000000000..37e7793e3
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/BuildSources/ElementServicesTest.csproj
@@ -0,0 +1,856 @@
+
+
+ ElementServicesTest
+ Library
+ false
+ $(DefineConstants);TARGET_NET3_5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/AssemblyInfo.cs b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/AssemblyInfo.cs
new file mode 100644
index 000000000..1b0a7ce1b
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/AssemblyInfo.cs
@@ -0,0 +1,12 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+//
+// This file specifies various assembly level attributes.
+//
+
+using System;
+using System.Security;
+
+[assembly:AllowPartiallyTrustedCallers]
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/BrowserApp.csproj b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/BrowserApp.csproj
new file mode 100644
index 000000000..abb20997d
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/BrowserApp.csproj
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+ Client
+ ControllerBrowserApp
+ AnyCPU
+ winexe
+ FeatureTests\ElementServices
+ true
+ Internet
+ true
+ False
+ True
+ 1.0.0.%2a
+
+
+ $(WpfTest)\Common\clickoncetest.pfx
+ cd582af19e477ae94a53102e0453e71b3c592a80
+
+
+ true
+ full
+ false
+ DEBUG;TRACE
+ 1
+
+
+ false
+ true
+ TRACE
+
+
+
+
+
+
+
+
+
+
+ false
+ TestRuntime
+ {C2FE511F-B1BA-42E2-A24F-41F93926DE51}
+
+
+
+ false
+ CoreTestsTrusted
+ {6D1A1BE6-D461-4726-A73E-DA7F0AAD1368}
+
+
+
+ false
+ ElementServicesTest
+ {CA0FEFED-E08A-4eb6-AB82-E70AB81C931B}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/ControllerBrowserApp.xaml b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/ControllerBrowserApp.xaml
new file mode 100644
index 000000000..f5d0e821b
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/ControllerBrowserApp.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/ControllerBrowserApp.xaml.cs b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/ControllerBrowserApp.xaml.cs
new file mode 100644
index 000000000..ffc196cdb
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/BrowserApp/ControllerBrowserApp.xaml.cs
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Windows;
+using Avalon.Test.CoreUI.Common;
+using Microsoft.Test.TestTypes;
+
+namespace Avalon.Test.CoreUI.Common
+{
+ public partial class ControllerBrowserApp : Application
+ {
+ void AppStartup(object sender, StartupEventArgs e)
+ {
+ ApplicationController proxy = new ApplicationController();
+ proxy.RunVariationLoop();
+ }
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/ControllerWpfApp.xaml b/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/ControllerWpfApp.xaml
new file mode 100644
index 000000000..51749bf9f
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/ControllerWpfApp.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/ControllerWpfApp.xaml.cs b/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/ControllerWpfApp.xaml.cs
new file mode 100644
index 000000000..9683b3f8b
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/ControllerWpfApp.xaml.cs
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Windows;
+using Avalon.Test.CoreUI.Common;
+using Microsoft.Test.TestTypes;
+
+namespace Avalon.Test.CoreUI.Common
+{
+ public partial class ControllerWpfApp : Application
+ {
+ void AppStartup(object sender, StartupEventArgs e)
+ {
+ ApplicationController proxy = new ApplicationController();
+ proxy.RunVariationLoop();
+ }
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/WpfApp.csproj b/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/WpfApp.csproj
new file mode 100644
index 000000000..b3436a397
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/WpfApp/WpfApp.csproj
@@ -0,0 +1,17 @@
+
+
+ ControllerWpfApp
+ winexe
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/ControllerApplications/dirs.proj b/src/Test/ElementServices/FeatureTests/ControllerApplications/dirs.proj
new file mode 100644
index 000000000..97b33a8e9
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/ControllerApplications/dirs.proj
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/Directory.Build.props b/src/Test/ElementServices/FeatureTests/Directory.Build.props
new file mode 100644
index 000000000..7516f266b
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Directory.Build.props
@@ -0,0 +1,7 @@
+
+
+
+ $(WpfTestBasePath)\ElementServices\FeatureTests\Trusted\CoreTestsTrusted.csproj
+ $(WpfFeatureTestBasePublishPath)\ElementServices
+
+
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/BuildSources/FreezablesTest.csproj b/src/Test/ElementServices/FeatureTests/Freezables/BuildSources/FreezablesTest.csproj
new file mode 100644
index 000000000..3a993eaf7
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/BuildSources/FreezablesTest.csproj
@@ -0,0 +1,39 @@
+
+
+ FreezablesTest
+ Library
+ Library
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Always
+ Always
+ Always
+ PreserveNewest
+
+
+
+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/BoolModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/BoolModifier.cs
new file mode 100644
index 000000000..7ce0d6281
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/BoolModifier.cs
@@ -0,0 +1,90 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked BooleanModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class BooleanModifier : System.Windows.Media.Animation.BooleanAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public BooleanModifier ( ModifierController c, bool b )
+ {
+ _controller = c;
+ _delta = b;
+ }
+ public BooleanModifier()
+ {
+ }
+ //----------------------------------------------------------
+ public new BooleanModifier GetAsFrozen()
+ {
+ return (BooleanModifier)base.GetAsFrozen();
+ }
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ BooleanModifier booleanModifier = (BooleanModifier)sourceFreezable;
+
+ base.CloneCore(sourceFreezable);
+ _controller = booleanModifier._controller;
+ _delta = booleanModifier._delta;
+ }
+ //----------------------------------------------------------
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ BooleanModifier booleanModifier = (BooleanModifier)sourceFreezable;
+
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = booleanModifier._controller;
+ _delta = booleanModifier._delta;
+ }
+ //----------------------------------------------------------
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ BooleanModifier booleanModifier = (BooleanModifier)sourceFreezable;
+
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = booleanModifier._controller;
+ _delta = booleanModifier._delta;
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new BooleanModifier();
+ }
+
+
+ protected override bool GetCurrentValueCore ( bool defaultOriginValue, bool baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if (!_controller.UsesBaseValue)
+ {
+ return _delta;
+ }
+ else
+ {
+ return (baseValue && _delta);
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private bool _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ByteModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ByteModifier.cs
new file mode 100644
index 000000000..e4390dc20
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ByteModifier.cs
@@ -0,0 +1,85 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked ByteModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class ByteModifier : System.Windows.Media.Animation.ByteAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public ByteModifier ( ModifierController c, System.Byte d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected ByteModifier()
+ {
+ }
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ ByteModifier byteModifier = (ByteModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = byteModifier._controller;
+ _delta = byteModifier._delta;
+ }
+ //----------------------------------------------------------
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ ByteModifier byteModifier = (ByteModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = byteModifier._controller;
+ _delta = byteModifier._delta;
+ }
+ //----------------------------------------------------------
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ ByteModifier byteModifier = (ByteModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = byteModifier._controller;
+ _delta = byteModifier._delta;
+ }
+ public new ByteModifier GetAsFrozen()
+ {
+ return (ByteModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new ByteModifier();
+ }
+
+ protected override System.Byte GetCurrentValueCore (System.Byte defaultOriginValue, System.Byte baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return (byte)(baseValue + _delta);
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private System.Byte _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/CharModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/CharModifier.cs
new file mode 100644
index 000000000..11475f85c
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/CharModifier.cs
@@ -0,0 +1,84 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked CharModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class CharModifier : System.Windows.Media.Animation.CharAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public CharModifier ( ModifierController c, char d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected CharModifier()
+ {
+ }
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ CharModifier charModifier = (CharModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = charModifier._controller;
+ _delta = charModifier._delta;
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ CharModifier charModifier = (CharModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = charModifier._controller;
+ _delta = charModifier._delta;
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ CharModifier charModifier = (CharModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = charModifier._controller;
+ _delta = charModifier._delta;
+ }
+ public new CharModifier GetAsFrozen()
+ {
+ return (CharModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new CharModifier();
+ }
+
+ protected override char GetCurrentValueCore(char defaultOriginValue, char baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if (!_controller.UsesBaseValue)
+ {
+ return _delta;
+ }
+ else
+ {
+ return (char)('a' + 'b');
+ }
+
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private char _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ColorModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ColorModifier.cs
new file mode 100644
index 000000000..3dfeda065
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ColorModifier.cs
@@ -0,0 +1,101 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked ColorModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class ColorModifier : System.Windows.Media.Animation.ColorAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public ColorModifier ( ModifierController c, float da, float dr, float dg, float db )
+ {
+ _controller = c;
+ _deltaA = da;
+ _deltaR = dr;
+ _deltaG = dg;
+ _deltaB = db;
+ }
+ protected ColorModifier()
+ {
+ }
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ ColorModifier colorModifier = (ColorModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = colorModifier._controller;
+ _deltaA = colorModifier._deltaA;
+ _deltaR = colorModifier._deltaR;
+ _deltaG = colorModifier._deltaG;
+ _deltaB = colorModifier._deltaB;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ ColorModifier colorModifier = (ColorModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = colorModifier._controller;
+ _deltaA = colorModifier._deltaA;
+ _deltaR = colorModifier._deltaR;
+ _deltaG = colorModifier._deltaG;
+ _deltaB = colorModifier._deltaB;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ ColorModifier colorModifier = (ColorModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = colorModifier._controller;
+ _deltaA = colorModifier._deltaA;
+ _deltaR = colorModifier._deltaR;
+ _deltaG = colorModifier._deltaG;
+ _deltaB = colorModifier._deltaB;
+
+ }
+ public new ColorModifier GetAsFrozen()
+ {
+ return (ColorModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new ColorModifier();
+ }
+ protected override System.Windows.Media.Color
+ GetCurrentValueCore(System.Windows.Media.Color defaultOriginValue, System.Windows.Media.Color baseValue, System.Windows.Media.Animation.AnimationClock clock)
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return System.Windows.Media.Color.FromScRgb ( _deltaA, _deltaR, _deltaG, _deltaB );
+ }
+ else
+ {
+ return System.Windows.Media.Color.FromScRgb ( baseValue.ScA + _deltaA, baseValue.ScR + _deltaR, baseValue.ScG + _deltaG, baseValue.ScB + _deltaB );
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private float _deltaA;
+ private float _deltaR;
+ private float _deltaG;
+ private float _deltaB;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/DecimalModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/DecimalModifier.cs
new file mode 100644
index 000000000..f4a75eb9a
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/DecimalModifier.cs
@@ -0,0 +1,86 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked DecimalModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class DecimalModifier : System.Windows.Media.Animation.DecimalAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public DecimalModifier ( ModifierController c, System.Decimal d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected DecimalModifier()
+ {
+ }
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ DecimalModifier decimalModifier = (DecimalModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = decimalModifier._controller;
+ _delta = decimalModifier._delta;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ DecimalModifier decimalModifier = (DecimalModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = decimalModifier._controller;
+ _delta = decimalModifier._delta;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ DecimalModifier decimalModifier = (DecimalModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = decimalModifier._controller;
+ _delta = decimalModifier._delta;
+
+ }
+ public new DecimalModifier GetAsFrozen()
+ {
+ return (DecimalModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new DecimalModifier();
+ }
+
+ protected override System.Decimal GetCurrentValueCore(System.Decimal defaultOriginValue, System.Decimal baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return baseValue + _delta;
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private System.Decimal _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/DoubleModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/DoubleModifier.cs
new file mode 100644
index 000000000..78f3ad7db
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/DoubleModifier.cs
@@ -0,0 +1,89 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked DoubleModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class DoubleModifier : System.Windows.Media.Animation.DoubleAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public DoubleModifier ( ModifierController c, double d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected DoubleModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ DoubleModifier doubleModifier = (DoubleModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = doubleModifier._controller;
+ _delta = doubleModifier._delta;
+
+ }
+ //----------------------------------------------------------
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ DoubleModifier doubleModifier = (DoubleModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = doubleModifier._controller;
+ _delta = doubleModifier._delta;
+
+ }
+ //----------------------------------------------------------
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ DoubleModifier doubleModifier = (DoubleModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = doubleModifier._controller;
+ _delta = doubleModifier._delta;
+
+ }
+ public new DoubleModifier GetAsFrozen()
+ {
+ return (DoubleModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new DoubleModifier();
+ }
+
+ protected override double GetCurrentValueCore (double defaultOriginValue, double baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return baseValue + _delta;
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/FloatModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/FloatModifier.cs
new file mode 100644
index 000000000..59238435b
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/FloatModifier.cs
@@ -0,0 +1,87 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked SingleModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class SingleModifier : System.Windows.Media.Animation.SingleAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public SingleModifier ( ModifierController c, float d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected SingleModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ SingleModifier singleModifier = (SingleModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = singleModifier._controller;
+ _delta = singleModifier._delta;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ SingleModifier singleModifier = (SingleModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = singleModifier._controller;
+ _delta = singleModifier._delta;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ SingleModifier singleModifier = (SingleModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = singleModifier._controller;
+ _delta = singleModifier._delta;
+
+ }
+ public new SingleModifier GetAsFrozen()
+ {
+ return (SingleModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new SingleModifier();
+ }
+
+ protected override float GetCurrentValueCore (float defaultOriginValue, float baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return baseValue + _delta;
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private float _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/IntModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/IntModifier.cs
new file mode 100644
index 000000000..5d4c8fd83
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/IntModifier.cs
@@ -0,0 +1,86 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked Int32Modifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class Int32Modifier : System.Windows.Media.Animation.Int32AnimationBase
+ {
+ //----------------------------------------------------------
+
+ public Int32Modifier ( ModifierController c, int d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected Int32Modifier()
+ {
+ }
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int32Modifier int32Modifier = (Int32Modifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = int32Modifier._controller;
+ _delta = int32Modifier._delta;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int32Modifier int32Modifier = (Int32Modifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = int32Modifier._controller;
+ _delta = int32Modifier._delta;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int32Modifier int32Modifier = (Int32Modifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = int32Modifier._controller;
+ _delta = int32Modifier._delta;
+
+ }
+ public new Int32Modifier GetAsFrozen()
+ {
+ return (Int32Modifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new Int32Modifier();
+ }
+
+ protected override int GetCurrentValueCore (int defaultOriginValue, int baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return baseValue + _delta;
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private int _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/LongModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/LongModifier.cs
new file mode 100644
index 000000000..4cb2ec5ba
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/LongModifier.cs
@@ -0,0 +1,88 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked Int64Modifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class Int64Modifier : System.Windows.Media.Animation.Int64AnimationBase
+ {
+ //----------------------------------------------------------
+
+ public Int64Modifier ( ModifierController c, long d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected Int64Modifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int64Modifier int64Modifier = (Int64Modifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = int64Modifier._controller;
+ _delta = int64Modifier._delta;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int64Modifier int64Modifier = (Int64Modifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = int64Modifier._controller;
+ _delta = int64Modifier._delta;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int64Modifier int64Modifier = (Int64Modifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = int64Modifier._controller;
+ _delta = int64Modifier._delta;
+
+ }
+ public new Int64Modifier GetAsFrozen()
+ {
+ return (Int64Modifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new Int64Modifier();
+ }
+
+
+ protected override long GetCurrentValueCore (long defaultOriginValue, long baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return baseValue + _delta;
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private long _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/MatrixModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/MatrixModifier.cs
new file mode 100644
index 000000000..d8b7c2bec
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/MatrixModifier.cs
@@ -0,0 +1,115 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked MatrixModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class MatrixModifier : System.Windows.Media.Animation.MatrixAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public MatrixModifier ( ModifierController c, double M11, double M12, double M21, double M22, double OffsetX, double OffsetY )
+ {
+ _controller = c;
+ _M11 = M11;
+ _M12 = M12;
+ _M21 = M21;
+ _M22 = M22;
+ _OffsetX = OffsetX;
+ _OffsetY = OffsetY;
+ }
+
+
+ protected MatrixModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ MatrixModifier matrixModifier = (MatrixModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = matrixModifier._controller;
+ _M11 = matrixModifier._M11;
+ _M12 = matrixModifier._M12;
+ _M21 = matrixModifier._M21;
+ _M22 = matrixModifier._M22;
+ _OffsetX = matrixModifier._OffsetX;
+ _OffsetY = matrixModifier._OffsetY;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ MatrixModifier matrixModifier = (MatrixModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = matrixModifier._controller;
+ _M11 = matrixModifier._M11;
+ _M12 = matrixModifier._M12;
+ _M21 = matrixModifier._M21;
+ _M22 = matrixModifier._M22;
+ _OffsetX = matrixModifier._OffsetX;
+ _OffsetY = matrixModifier._OffsetY;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ MatrixModifier matrixModifier = (MatrixModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = matrixModifier._controller;
+ _M11 = matrixModifier._M11;
+ _M12 = matrixModifier._M12;
+ _M21 = matrixModifier._M21;
+ _M22 = matrixModifier._M22;
+ _OffsetX = matrixModifier._OffsetX;
+ _OffsetY = matrixModifier._OffsetY;
+
+ }
+ public new MatrixModifier GetAsFrozen()
+ {
+ return (MatrixModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new MatrixModifier();
+ }
+
+ protected override System.Windows.Media.Matrix GetCurrentValueCore(System.Windows.Media.Matrix defaultOriginValue, System.Windows.Media.Matrix baseValue, System.Windows.Media.Animation.AnimationClock clock)
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return new System.Windows.Media.Matrix(_M11, _M12, _M21, _M22, _OffsetX, _OffsetY);
+ }
+ else
+ {
+ return new System.Windows.Media.Matrix (baseValue.M11 + _M11, baseValue.M12 + _M12,
+ baseValue.M21 + _M21, baseValue.M22 + _M22, baseValue.OffsetX + _OffsetX, baseValue.OffsetY + _OffsetY);
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _M11;
+ private double _M12;
+ private double _M21;
+ private double _M22;
+ private double _OffsetX;
+ private double _OffsetY;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ModifierController.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ModifierController.cs
new file mode 100644
index 000000000..ce1e84164
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ModifierController.cs
@@ -0,0 +1,45 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Common part of all the test Modifiers
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // Unfortunately I cannot use inheritance to factor out all the commonalities
+ // between different Modifiers I use in testing IAnimatable. So I am using delegation.
+ // This class to be hooked in every Modifier used for IAnimatable property & rendering
+ // testing
+
+ public class ModifierController
+ {
+ //----------------------------------------------------------
+
+ public void SetDefaultParentTimeline ( System.Windows.Media.Animation.Timeline tml )
+ {
+ _timeline = tml;
+ }
+
+ //----------------------------------------------------------
+
+ public System.Windows.Media.Animation.Timeline
+ Timeline { get { return _timeline; } }
+ public bool UsesBaseValue { get { return _usesBase; } set { _usesBase = value; } }
+
+ //----------------------------------------------------------
+
+ private System.Windows.Media.Animation.Timeline _timeline;
+ private bool _usesBase;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/MyFreezable.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/MyFreezable.cs
new file mode 100644
index 000000000..41952cfeb
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/MyFreezable.cs
@@ -0,0 +1,97 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: MyFreezable
+
+ *
+ ************************************************************/
+using System;
+
+//------------------------------------------------------------------
+namespace Microsoft.Test.ElementServices.Freezables.Objects
+{
+ //--------------------------------------------------------------
+ /*
+ //This object is created to provide more granular testings as failures are clearly realted to Freezable
+ //logic, and not influenced by misuse of the framework or core code
+ */
+ public class MyFreezable : System.Windows.Freezable
+ {
+ //--------------------------------
+ public MyFreezable()
+ {
+ }
+
+ //--------------------------------
+ public MyFreezable(System.Windows.Freezable ChObj)
+ {
+ FreezableObj = ChObj;
+ }
+
+ //--------------------------------
+ public System.Windows.Freezable FreezableObj
+ {
+ get
+ {
+ ReadPreamble();
+ return _changeableObj;
+ }
+ set
+ {
+ if (_changeableObj != value)
+ {
+ WritePreamble();
+ OnFreezablePropertyChanged(_changeableObj, value);
+ _changeableObj = value;
+ WritePostscript();
+ }
+ }
+ }
+
+ //--------------------------------
+ protected override bool FreezeCore(bool IsChecking)
+ {
+ return System.Windows.Freezable.Freeze(_changeableObj, IsChecking);
+ }
+
+ //--------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ MyFreezable myFreezable = (MyFreezable)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _changeableObj = myFreezable._changeableObj;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ MyFreezable myFreezable = (MyFreezable)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _changeableObj = myFreezable._changeableObj;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ MyFreezable myFreezable = (MyFreezable)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _changeableObj = myFreezable._changeableObj;
+
+ }
+ public new MyFreezable GetAsFrozen()
+ {
+ return (MyFreezable)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new MyFreezable();
+ }
+
+ //--------------------------------
+ private System.Windows.Freezable _changeableObj;
+
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/Point3DModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/Point3DModifier.cs
new file mode 100644
index 000000000..169f9cf7f
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/Point3DModifier.cs
@@ -0,0 +1,100 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked Point3DModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class Point3DModifier : System.Windows.Media.Animation.Point3DAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public Point3DModifier ( ModifierController c, double dx, double dy, double dz )
+ {
+ _controller = c;
+ _deltaX = dx;
+ _deltaY = dy;
+ _deltaZ = dz;
+ }
+
+ protected Point3DModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ Point3DModifier point3DModifier = (Point3DModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = point3DModifier._controller;
+ _deltaX = point3DModifier._deltaX;
+ _deltaY = point3DModifier._deltaY;
+ _deltaZ = point3DModifier._deltaZ;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Point3DModifier point3DModifier = (Point3DModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = point3DModifier._controller;
+ _deltaX = point3DModifier._deltaX;
+ _deltaY = point3DModifier._deltaY;
+ _deltaZ = point3DModifier._deltaZ;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Point3DModifier point3DModifier = (Point3DModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = point3DModifier._controller;
+ _deltaX = point3DModifier._deltaX;
+ _deltaY = point3DModifier._deltaY;
+ _deltaZ = point3DModifier._deltaZ;
+
+ }
+ public new Point3DModifier GetAsFrozen()
+ {
+ return (Point3DModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new Point3DModifier();
+ }
+
+
+ protected override System.Windows.Media.Media3D.Point3D
+ GetCurrentValueCore (System.Windows.Media.Media3D.Point3D defaultOriginValue, System.Windows.Media.Media3D.Point3D baseValue , System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return new System.Windows.Media.Media3D.Point3D ( _deltaX, _deltaY, _deltaZ );
+ }
+ else
+ {
+ return new System.Windows.Media.Media3D.Point3D ( baseValue.X + _deltaX, baseValue.Y + _deltaY, baseValue.Z + _deltaZ );
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _deltaX;
+ private double _deltaY;
+ private double _deltaZ;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/PointModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/PointModifier.cs
new file mode 100644
index 000000000..8fd48a71d
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/PointModifier.cs
@@ -0,0 +1,89 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked PointModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class PointModifier : System.Windows.Media.Animation.PointAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public PointModifier ( ModifierController c, double dx, double dy )
+ {
+ _controller = c;
+ _deltaX = dx;
+ _deltaY = dy;
+ }
+ protected PointModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ PointModifier pointModifier = (PointModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = pointModifier._controller;
+ _deltaX = pointModifier._deltaX;
+ _deltaY = pointModifier._deltaY;
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ PointModifier pointModifier = (PointModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = pointModifier._controller;
+ _deltaX = pointModifier._deltaX;
+ _deltaY = pointModifier._deltaY;
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ PointModifier pointModifier = (PointModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = pointModifier._controller;
+ _deltaX = pointModifier._deltaX;
+ _deltaY = pointModifier._deltaY;
+ }
+ public new PointModifier GetAsFrozen()
+ {
+ return (PointModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new PointModifier();
+ }
+ protected override System.Windows.Point
+ GetCurrentValueCore(System.Windows.Point defaultOriginValue, System.Windows.Point baseValue, System.Windows.Media.Animation.AnimationClock clock)
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return new System.Windows.Point ( _deltaX, _deltaY );
+ }
+ else
+ {
+ return new System.Windows.Point ( baseValue.X + _deltaX, baseValue.Y + _deltaY );
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _deltaX;
+ private double _deltaY;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/PredefinedObjects.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/PredefinedObjects.cs
new file mode 100644
index 000000000..bb7801173
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/PredefinedObjects.cs
@@ -0,0 +1,1362 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Factory of predefined objects
+
+ *
+ ************************************************************/
+using System;
+using System.IO;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Generic;
+
+using Microsoft.Test;
+using Microsoft.Test.Logging;
+using Microsoft.Test.ElementServices.Freezables.Modifiers;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Objects
+{
+ /**********************************************************************************
+ * CLASS: PredefinedObjects
+ **********************************************************************************/
+ public class PredefinedObjects
+ {
+ #region Private Data
+ private static string s_jpegFile = "BORG.jpg";
+ #endregion
+
+
+ //----------------------------------------------------------
+ //
+
+
+ #region Public and Protected Members
+ /******************************************************************************
+ * Function: MakeValue
+ ******************************************************************************/
+ public static object MakeValue (PropertyInfo p)
+ {
+ return MakeTypeNameValue (p.PropertyType.ToString (), true);
+ }
+
+ /******************************************************************************
+ * Function: MakeValue
+ ******************************************************************************/
+ public static object MakeValue (Type t)
+ {
+ return MakeTypeNameValue(t.FullName.ToString(), true);
+ }
+
+ /******************************************************************************
+ * Function: MakeSecondValue
+ ******************************************************************************/
+ public static object MakeSecondValue(Type t)
+ {
+ return MakeTypeNameValue(t.FullName.ToString(), false);
+ }
+
+
+ /******************************************************************************
+ * Function: MakeTypeNameValue
+ ******************************************************************************/
+ private static object MakeTypeNameValue(string name, bool firstOption)
+ {
+ switch (name)
+ {
+ case "System.Boolean":
+ {
+ return (firstOption) ? true : false;
+ }
+
+ case "System.Char":
+ {
+ return '0';
+ }
+
+ case "System.Single" :
+ {
+ return (firstOption) ? Convert.ToSingle(true):Convert.ToSingle(false);
+ }
+
+ case "System.Int32" :
+ {
+ return (firstOption) ? 0 : 2;
+ }
+ case "System.Int32[]":
+ {
+ System.Int32[] retval = new System.Int32[1];
+
+ return (firstOption) ? retval[0] = 2 : retval[0] = 1;
+ }
+ case "System.Double":
+ {
+ return (firstOption) ? 0.4 : 0.3;
+ }
+ case "System.Double[]":
+ {
+ System.Double[] retval = new System.Double[1];
+
+ return (firstOption) ? retval[0] = 0.4 : retval[0] = 0.3;
+ }
+ case "System.String":
+ {
+ return (firstOption) ? "":"a";
+ }
+
+ case "System.Byte":
+ {
+ return Convert.ToByte("0", System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ case "System.Byte[]":
+ {
+ System.Byte[] retval = new System.Byte[1];
+ retval[0] = Convert.ToByte("10", System.Globalization.CultureInfo.InvariantCulture);
+ return retval;
+ }
+ case "System.Decimal":
+ {
+ return Convert.ToDecimal("0", System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ case "System.Int16":
+ {
+ return Convert.ToInt16("0", System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ case "System.Int64":
+ {
+ return Convert.ToInt64("0", System.Globalization.CultureInfo.InvariantCulture);
+ }
+
+ case "System.IntPtr" :
+ {
+ return IntPtr.Zero;
+ }
+ case "System.Object":
+ {
+ return new System.Object();
+ }
+ case "System.TimeSpan":
+ {
+ return new System.TimeSpan(0, 0, 1);
+ }
+
+ case "System.UInt16[]":
+ {
+ System.UInt16[] retval = new System.UInt16[1];
+
+ retval[0] = Convert.ToUInt16("0", System.Globalization.CultureInfo.InvariantCulture);
+ return retval;
+ }
+ case "System.Uri":
+ {
+ System.Uri retval = new System.Uri(s_jpegFile, UriKind.RelativeOrAbsolute);
+ return retval;
+ }
+ case "System.Windows.DependencyProperty":
+ {
+ System.Windows.DependencyObject dobj = new System.Windows.DependencyObject();
+ return null;//System.Windows.DependencyProperty.FromName("ChangeableTest", dobj.GetType());
+ }
+
+ case "System.Windows.DependencyObject":
+ {
+
+ return new System.Windows.DependencyObject();
+ }
+ case "System.Windows.Vector" :
+ {
+ return (firstOption) ? new System.Windows.Vector(1.2, 3.7) : new System.Windows.Vector(1.3, 3.8);
+ }
+ case "System.Windows.Vector[]":
+ {
+ System.Windows.Vector[] retval = new System.Windows.Vector[1];
+
+ return (firstOption) ? retval[0] = new System.Windows.Vector(1.2, 3.7) : retval[0] = new System.Windows.Vector(1.3, 3.8);
+ }
+
+ case "System.Windows.Media.BrushMappingMode" :
+ {
+ return (firstOption) ? System.Windows.Media.BrushMappingMode.RelativeToBoundingBox : System.Windows.Media.BrushMappingMode.Absolute ;
+ }
+ case "System.Windows.Media.Stretch" :
+ {
+ return (firstOption) ? System.Windows.Media.Stretch.Fill : System.Windows.Media.Stretch.None;
+ }
+ case "System.Windows.Media.HorizontalAlignment" :
+ {
+ return (firstOption) ? System.Windows.Media.AlignmentX.Left : System.Windows.Media.AlignmentX.Right;
+ }
+ case "System.Windows.Media.VerticalAlignment" :
+ {
+ return (firstOption) ? System.Windows.Media.AlignmentY.Top : System.Windows.Media.AlignmentY.Bottom;
+ }
+
+ case "System.Windows.Media.TileMode" :
+ {
+ return (firstOption) ? System.Windows.Media.TileMode.None : System.Windows.Media.TileMode.Tile;
+ }
+ case "System.Windows.Media.ColorInterpolationMode" :
+ {
+ return (firstOption) ? System.Windows.Media.ColorInterpolationMode.SRgbLinearInterpolation : System.Windows.Media.ColorInterpolationMode.ScRgbLinearInterpolation;
+ }
+ case "System.Windows.Media.GradientSpreadMethod" :
+ {
+ return (firstOption) ? System.Windows.Media.GradientSpreadMethod.Pad : System.Windows.Media.GradientSpreadMethod.Reflect;
+ }
+
+ case "System.Windows.Point" :
+ {
+ return (firstOption) ? new System.Windows.Point(10.0, 20.0) : new System.Windows.Point(10.1, 20.1);
+ }
+ case "System.Windows.Point[]":
+ {
+ System.Windows.Point[] retval = new System.Windows.Point[1];
+ retval[0] = new System.Windows.Point (10.0, 20.0);
+ return retval;
+ }
+
+ case "System.Windows.Size":
+ {
+ return firstOption ? new System.Windows.Size(50.0, 70.0) : new System.Windows.Size(50.1, 70.1);
+ }
+
+ case "System.Windows.Rect":
+ {
+ return firstOption ? new System.Windows.Rect(10.0, 20.0, 50.0, 70.0) : new System.Windows.Rect(10.1, 20.0, 50.1, 70.0);
+ }
+ case "System.Windows.FrameworkContentElement":
+ {
+ return new System.Windows.FrameworkContentElement();
+ }
+ case "System.Windows.FrameworkElement":
+ {
+ return new System.Windows.Controls.Button();
+ }
+ case "System.Windows.FrameworkTemplate":
+ {
+ return new System.Windows.Controls.ControlTemplate();
+ }
+
+ case "System.Windows.Media.Color":
+ {
+ return firstOption ? System.Windows.Media.Color.FromScRgb(0.8f, 0.7f, 0.5f, 0.1f) : System.Windows.Media.Color.FromScRgb(0.9f, 0.8f, 0.6f, 0.2f);
+ }
+ case "System.Windows.Media.Color[]":
+ {
+ System.Windows.Media.Color[] retval = new System.Windows.Media.Color[1];
+
+ return firstOption ? retval[0] = System.Windows.Media.Color.FromScRgb(0.8f, 0.7f, 0.5f, 0.1f) : retval[0] = System.Windows.Media.Color.FromScRgb(0.9f, 0.8f, 0.6f, 0.2f);
+ }
+
+ case "System.Windows.Color[]":
+ {
+ System.Windows.Media.Color[] retval = new System.Windows.Media.Color[1];
+
+ retval[0] = System.Windows.Media.Color.FromScRgb (0.8f, 0.7f, 0.5f, 0.1f);
+ return retval;
+ }
+ case "System.Windows.Media.Drawing":
+ {
+ return new System.Windows.Media.DrawingGroup ();
+ }
+ case "System.Windows.Media.Matrix":
+ {
+ return firstOption ? new System.Windows.Media.Matrix(1.0, 0.0, 0.0, 1.0, 0.0, 0.0) : new System.Windows.Media.Matrix(2.0, 0.0, 0.0, 1.0, 0.0, 0.0);
+ }
+ case "System.Windows.Media.Transform":
+ {
+ return new System.Windows.Media.TranslateTransform (17.0, 3.0);
+ }
+ case "System.Windows.Media.Transform[]":
+ {
+ System.Windows.Media.Transform[] retval = new System.Windows.Media.Transform[1];
+ retval[0] = new System.Windows.Media.TranslateTransform (17.0, 3.0);
+ return retval;
+ }
+ case "System.Windows.Media.Brush":
+ {
+ return new System.Windows.Media.SolidColorBrush (System.Windows.Media.Color.FromScRgb (0.7f, 0.55f, 1.0f, 0.1f));
+ }
+
+ case "System.Windows.Media.GeometryCombineMode":
+ {
+ return (firstOption) ? System.Windows.Media.GeometryCombineMode.Union : System.Windows.Media.GeometryCombineMode.Intersect;
+ }
+
+ case "System.Windows.Media.FillRule":
+ {
+ return firstOption ? System.Windows.Media.FillRule.EvenOdd : System.Windows.Media.FillRule.Nonzero;
+ }
+ case "System.Windows.Media.Pen" :
+ {
+ System.Windows.Media.SolidColorBrush scb = new System.Windows.Media.SolidColorBrush (System.Windows.Media.Color.FromScRgb (1f, 0.1f, 1.0f, 0.7f));
+ return new System.Windows.Media.Pen(scb, 2.0);
+ }
+ case "System.Windows.Media.PenLineCap" :
+ {
+ return (firstOption) ? System.Windows.Media.PenLineCap.Flat : System.Windows.Media.PenLineCap.Round;
+ }
+ case "System.Windows.Media.PenLineJoin" :
+ {
+ return (firstOption) ? System.Windows.Media.PenLineJoin.Miter : System.Windows.Media.PenLineJoin.Round;
+ }
+
+ case "System.Windows.Media.Geometry" :
+ {
+ System.Windows.Media.TranslateTransform tt = new System.Windows.Media.TranslateTransform (17.0, 3.0);
+ return new System.Windows.Media.EllipseGeometry (new System.Windows.Point(10.0,10.0), 20.0, 150.0, tt);
+ }
+ case "System.Windows.Media.Geometry[]":
+ {
+ System.Windows.Media.Geometry[] retval = new System.Windows.Media.Geometry[1];
+ retval[0] = new System.Windows.Media.EllipseGeometry (new System.Windows.Rect (10.0, 20.0, 150.0, 90.0));
+ return retval;
+ }
+ case "System.Windows.Media.GradientStop":
+ {
+ return new System.Windows.Media.GradientStop (System.Windows.Media.Color.FromScRgb (0.7f, 0.55f, 1.0f, 0.1f), 0.0);
+ }
+ case "System.Windows.Media.GradientStop[]":
+ {
+ System.Windows.Media.GradientStop[] retval = new System.Windows.Media.GradientStop[1];
+
+ retval[0] = new System.Windows.Media.GradientStop (System.Windows.Media.Color.FromScRgb (0.7f, 0.55f, 1.0f, 0.1f), 0.0);
+ return retval;
+ }
+
+ case "System.Windows.Media.GradientStopCollection":
+ {
+ System.Windows.Media.GradientStopCollection retval = new System.Windows.Media.GradientStopCollection ();
+
+ retval.Add (new System.Windows.Media.GradientStop (System.Windows.Media.Color.FromScRgb (0.7f, 1.0f, 0.0f, 0.1f), 0.0));
+ retval.Add (new System.Windows.Media.GradientStop (System.Windows.Media.Color.FromScRgb (0.2f, 0.0f, 1.0f, 0.7f), 1.0));
+ return retval;
+ }
+
+ case "System.Windows.Media.PathSegmentCollection":
+ {
+ return MakePathSegmentCollection ();
+ }
+
+ case "System.Windows.Media.PathSegment":
+ {
+ return new System.Windows.Media.LineSegment (new System.Windows.Point (10.0, 20.0), true);
+ }
+ case "System.Windows.Media.PathSegment[]":
+ {
+ System.Windows.Media.PathSegment[] retval = new System.Windows.Media.PathSegment[1];
+ retval[0] = new System.Windows.Media.LineSegment (new System.Windows.Point (10.0, 20.0), true);
+ return retval;
+ }
+ case "System.Windows.Media.PathFigureCollection":
+ {
+ System.Windows.Media.PathFigureCollection retval = new System.Windows.Media.PathFigureCollection ();
+
+ retval.Add (new System.Windows.Media.PathFigure (new System.Windows.Point(0, 0), MakePathSegmentCollection (), false));
+ return retval;
+ }
+
+ case "System.Windows.Media.PathFigure":
+ {
+ return new System.Windows.Media.PathFigure(new System.Windows.Point(0, 0), MakePathSegmentCollection(), false);
+ }
+
+ case "System.Windows.Media.PathFigure[]":
+ {
+ System.Windows.Media.PathFigure[] retval = new System.Windows.Media.PathFigure[1];
+
+ retval[0] = new System.Windows.Media.PathFigure(new System.Windows.Point(0, 0), MakePathSegmentCollection(), false);
+ return retval;
+ }
+ case "System.Windows.Media.PathGeometry" :
+ {
+ System.Windows.Media.PathFigure[] tmp = new System.Windows.Media.PathFigure[1];
+
+ tmp[0] = new System.Windows.Media.PathFigure(new System.Windows.Point(0, 0), MakePathSegmentCollection(), false);
+ return new System.Windows.Media.PathGeometry(tmp);
+ }
+ case "System.Windows.PointCollection":
+ {
+ return MakePointCollection();
+ }
+
+ case "System.Collections.ICollection":
+ {
+ return null;
+ }
+ case "System.Windows.Media.ColorContext":
+ {
+ return new System.Windows.Media.ColorContext(System.Windows.Media.PixelFormats.Bgra32);
+ }
+ case "System.Windows.Media.PixelFormat":
+ {
+ return System.Windows.Media.PixelFormats.Pbgra32;
+ }
+ case "System.IO.Stream":
+ {
+ try
+ {
+ return new FileStream(s_jpegFile, FileMode.Open, FileAccess.Read, FileShare.Read);
+ }
+ catch (System.IO.IOException e)
+ {
+ GlobalLog.LogEvidence("Images on av-image could not be accesssed: {0}", e.Message);
+ return null;
+ }
+ }
+ case "System.Windows.Length":
+ {
+ return 3.0;
+ }
+ case "System.Windows.Thickness":
+ {
+ return new System.Windows.Thickness(3.0);
+ }
+ case "System.Windows.Media.Imaging.CodecInfo":
+ {
+ System.Windows.Media.Imaging.JpegBitmapEncoder ie = new System.Windows.Media.Imaging.JpegBitmapEncoder();
+ return ie.CodecInfo;
+ }
+ case "System.Windows.Media.Imaging.BitmapCacheOption":
+ {
+ return System.Windows.Media.Imaging.BitmapCacheOption.Default;
+ }
+ case "System.Windows.Media.Imaging.BitmapCreateOptions":
+ {
+ return System.Windows.Media.Imaging.BitmapCreateOptions.None;
+ }
+ case "System.Windows.Media.Imaging.BitmapPalette":
+ {
+ List colors = new List();
+ colors.Add(System.Windows.Media.Color.FromScRgb(0.7f, 0.5f, 0.3f, 0.1f));
+ colors.Add(System.Windows.Media.Color.FromScRgb(0.1f, 0.3f, 0.5f, 0.7f));
+ return new System.Windows.Media.Imaging.BitmapPalette(colors);
+ }
+
+ case "System.Windows.Media.Media3D.Geometry3D":
+ {
+ //Geometry3D is an abstact class, so use MeshGeometry3D instead
+ return new System.Windows.Media.Media3D.MeshGeometry3D();
+ }
+ case "System.Windows.Media.Media3D.Quaternion":
+ {
+ return new System.Windows.Media.Media3D.Quaternion (0.0, 1.0, 2.0, 3.0);
+ }
+ case "System.Windows.Media.Media3D.Material":
+ {
+ return new System.Windows.Media.Media3D.DiffuseMaterial();
+ }
+
+ case "System.Windows.Media.Media3D.Model3D":
+ {
+ return new System.Windows.Media.Media3D.AmbientLight();
+ }
+
+ case "System.Windows.Media.Media3D.Model3D[]":
+ {
+ System.Windows.Media.Media3D.Model3D[] retval = new System.Windows.Media.Media3D.Model3D[1];
+
+ retval[0] = new System.Windows.Media.Media3D.AmbientLight();
+ return retval;
+ }
+
+ case "System.Windows.Media.Media3D.Point3D":
+ {
+ return new System.Windows.Media.Media3D.Point3D(1.0, 2.0, 3.0);
+ }
+
+ case "System.Windows.Media.Media3D.Point3D[]":
+ {
+ System.Windows.Media.Media3D.Point3D[] retval = new System.Windows.Media.Media3D.Point3D[1];
+
+ retval[0] = new System.Windows.Media.Media3D.Point3D(1.0, 2.0, 3.0);
+ return retval;
+ }
+
+ case "System.Windows.Media.Media3D.Vector3D":
+ {
+ return new System.Windows.Media.Media3D.Vector3D (100.0, 200.0, 3.0);
+ }
+ case "System.Windows.Media.Media3D.Vector3D[]":
+ {
+ System.Windows.Media.Media3D.Vector3D[] retval = new System.Windows.Media.Media3D.Vector3D[1];
+ retval[0] = new System.Windows.Media.Media3D.Vector3D(100.0, 200.0, 3.0);
+ return retval;
+ }
+ case "System.Windows.Media.Media3D.Matrix3D":
+ {
+ return new System.Windows.Media.Media3D.Matrix3D (0.5, 1.2, 1.1, 0.0, 0.5, 1.2, 1.1, 0.0, 0.5, 1.2, 1.1, 0.0, 0.5, 1.2, 1.1, 0.0);
+ }
+
+ case "System.Windows.Media.Media3D.Transform3D":
+ {
+ return new System.Windows.Media.Media3D.TranslateTransform3D (new System.Windows.Media.Media3D.Vector3D (10.0, 20.0, 3.0));
+ }
+ case "System.Windows.Media.Media3D.Transform3D[]":
+ {
+ System.Windows.Media.Media3D.Transform3D[] retval = new System.Windows.Media.Media3D.Transform3D[1];
+
+ retval[0] = new System.Windows.Media.Media3D.TranslateTransform3D (new System.Windows.Media.Media3D.Vector3D (10.0, 20.0, 3.0));
+ return retval;
+ }
+
+ case "System.Windows.Media.Media3D.MeshGeometry3D":
+ {
+ return new System.Windows.Media.Media3D.MeshGeometry3D ();
+ }
+ case "System.Windows.Media.Imaging.BitmapCodecInfo":
+ {
+ Stream imageStream = new System.IO.FileStream (s_jpegFile, FileMode.Open, FileAccess.Read, FileShare.Read);
+ System.Windows.Media.Imaging.BitmapDecoder dec = System.Windows.Media.Imaging.BitmapDecoder.Create(imageStream, System.Windows.Media.Imaging.BitmapCreateOptions.None, System.Windows.Media.Imaging.BitmapCacheOption.Default);
+ System.Windows.Media.Imaging.BitmapCodecInfo ci = dec.CodecInfo;
+ imageStream.Close();
+ return ci;
+ }
+
+ case "System.Windows.Media.Imaging.BitmapSource":
+ {
+ try
+ {
+ Stream imageStream = new FileStream(s_jpegFile, FileMode.Open, FileAccess.Read, FileShare.Read);
+ System.Windows.Media.Imaging.BitmapSource bsrc = System.Windows.Media.Imaging.BitmapFrame.Create(imageStream);
+
+ return bsrc;
+ }
+ catch (System.IO.IOException e)
+ {
+ GlobalLog.LogEvidence("Images on av-image could not be accesssed: {0}", e.Message);
+ return null;
+ }
+ }
+ case "System.Windows.Media.Imaging.BitmapSizeOptions":
+ {
+ return System.Windows.Media.Imaging.BitmapSizeOptions.FromWidthAndHeight(100, 100);
+ }
+
+ case "System.Windows.Media.Imaging.Rotation":
+ {
+ return System.Windows.Media.Imaging.Rotation.Rotate0;
+ }
+
+ case "System.Windows.Int32Rect" :
+ {
+ return new System.Windows.Int32Rect(0, 0, 100, 100);
+ }
+
+ case "System.Windows.Media.Animation.AnimationEffect":
+ {
+ //
+ return null;
+ }
+ case "System.Windows.Media.Animation.BooleanKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteBooleanKeyFrame(true);
+ }
+ case "System.Windows.Media.Animation.BooleanKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteBooleanKeyFrame [] bkf = new System.Windows.Media.Animation.DiscreteBooleanKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteBooleanKeyFrame(true);
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.ByteKeyFrame":
+ {
+ return new System.Windows.Media.Animation.LinearByteKeyFrame(Convert.ToByte("1", System.Globalization.CultureInfo.InvariantCulture));
+ }
+ case "System.Windows.Media.Animation.ByteKeyFrame[]":
+ {
+ System.Windows.Media.Animation.LinearByteKeyFrame [] retval = new System.Windows.Media.Animation.LinearByteKeyFrame[1];
+ retval[0] = new System.Windows.Media.Animation.LinearByteKeyFrame(Convert.ToByte("1", System.Globalization.CultureInfo.InvariantCulture));
+ return retval;
+ }
+ case "System.Windows.Media.Animation.CharKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteCharKeyFrame('a');
+ }
+ case "System.Windows.Media.Animation.CharKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteCharKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteCharKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteCharKeyFrame('a');
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.Clock":
+ {
+ System.Windows.Media.Animation.DoubleAnimation timeline = new System.Windows.Media.Animation.DoubleAnimation();
+ return timeline.CreateClock();
+ }
+ case "System.Windows.Media.Animation.ClockGroup":
+ {
+ System.Windows.Media.Animation.ParallelTimeline timeline = new System.Windows.Media.Animation.ParallelTimeline();
+ System.Windows.Media.Animation.ClockGroup cg = timeline.CreateClock();
+ return cg;
+ }
+ case "System.Windows.Media.Animation.ClockController":
+ {
+ System.Windows.Media.Animation.DoubleAnimation timeline = new System.Windows.Media.Animation.DoubleAnimation();
+ System.Windows.Media.Animation.Clock clock = timeline.CreateClock();
+ return clock.Controller;
+ }
+ case "System.Windows.Media.Animation.ColorKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteColorKeyFrame(System.Windows.Media.Color.FromScRgb(1.0f, 0.2f, 0.2f, 0.4f));
+ }
+ case "System.Windows.Media.Animation.ColorKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteColorKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteColorKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteColorKeyFrame(System.Windows.Media.Color.FromScRgb(1.0f, 0.2f, 0.2f, 0.4f));
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.DecimalKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteDecimalKeyFrame(Convert.ToDecimal("0", System.Globalization.CultureInfo.InvariantCulture));
+ }
+ case "System.Windows.Media.Animation.DecimalKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteDecimalKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteDecimalKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteDecimalKeyFrame(Convert.ToDecimal("0", System.Globalization.CultureInfo.InvariantCulture));
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.DoubleKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteDoubleKeyFrame(2.0);
+ }
+ case "System.Windows.Media.Animation.DoubleKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteDoubleKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteDoubleKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteDoubleKeyFrame(2.0);
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.HandoffBehavior":
+ {
+ return System.Windows.Media.Animation.HandoffBehavior.Compose;
+ }
+ case "System.Windows.Media.Animation.Int16KeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteInt16KeyFrame(Convert.ToInt16("0", System.Globalization.CultureInfo.InvariantCulture));
+ }
+ case "System.Windows.Media.Animation.Int16KeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteInt16KeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteInt16KeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteInt16KeyFrame(Convert.ToInt16("0", System.Globalization.CultureInfo.InvariantCulture));
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.Int32KeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteInt32KeyFrame(0);
+ }
+ case "System.Windows.Media.Animation.Int32KeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteInt32KeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteInt32KeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteInt32KeyFrame(0);
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.Int64KeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteInt64KeyFrame(Convert.ToInt64("0", System.Globalization.CultureInfo.InvariantCulture));
+ }
+ case "System.Windows.Media.Animation.Int64KeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteInt64KeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteInt64KeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteInt64KeyFrame(Convert.ToInt64("0", System.Globalization.CultureInfo.InvariantCulture));
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.MatrixKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteMatrixKeyFrame(new System.Windows.Media.Matrix(1.0, 1.0, 2.0, 2.0, 1.0, 1.0));
+ }
+ case "System.Windows.Media.Animation.MatrixKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteMatrixKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteMatrixKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteMatrixKeyFrame(new System.Windows.Media.Matrix(1.0, 1.0, 2.0, 2.0, 1.0, 1.0));
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.ObjectKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteObjectKeyFrame(new object());
+ }
+ case "System.Windows.Media.Animation.ObjectKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteObjectKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteObjectKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteObjectKeyFrame(new object());
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.Point3DKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscretePoint3DKeyFrame();
+ }
+ case "System.Windows.Media.Animation.Point3DKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscretePoint3DKeyFrame[] bkf = new System.Windows.Media.Animation.DiscretePoint3DKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscretePoint3DKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.PointKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscretePointKeyFrame();
+ }
+ case "System.Windows.Media.Animation.PointKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscretePointKeyFrame[] bkf = new System.Windows.Media.Animation.DiscretePointKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscretePointKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.QuaternionKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame();
+ }
+ case "System.Windows.Media.Animation.QuaternionKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteQuaternionKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.RectKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteRectKeyFrame();
+ }
+ case "System.Windows.Media.Animation.RectKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteRectKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteRectKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteRectKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.Rotation3DKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame();
+ }
+ case "System.Windows.Media.Animation.Rotation3DKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteRotation3DKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.SingleKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteSingleKeyFrame();
+ }
+ case "System.Windows.Media.Animation.SingleKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteSingleKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteSingleKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteSingleKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.SizeKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteSizeKeyFrame();
+ }
+ case "System.Windows.Media.Animation.SizeKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteSizeKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteSizeKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteSizeKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.StringKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteStringKeyFrame();
+ }
+ case "System.Windows.Media.Animation.StringKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteStringKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteStringKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteStringKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.Storyboard":
+ {
+ return new System.Windows.Media.Animation.Storyboard();
+ }
+ case "System.Windows.Media.Animation.ThicknessKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteThicknessKeyFrame(new System.Windows.Thickness(3.0));
+ }
+ case "System.Windows.Media.Animation.ThicknessKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteThicknessKeyFrame [] tkf = new System.Windows.Media.Animation.DiscreteThicknessKeyFrame[1];
+ tkf[0] = new System.Windows.Media.Animation.DiscreteThicknessKeyFrame(new System.Windows.Thickness(3.0));
+ return tkf;
+ }
+ case "System.Windows.Media.Animation.TimeSeekOrigin":
+ {
+ return System.Windows.Media.Animation.TimeSeekOrigin.BeginTime;
+ }
+ case "System.Windows.Media.Animation.Vector3DKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteVector3DKeyFrame();
+ }
+ case "System.Windows.Media.Animation.Vector3DKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteVector3DKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteVector3DKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteVector3DKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.VectorKeyFrame":
+ {
+ return new System.Windows.Media.Animation.DiscreteVectorKeyFrame();
+ }
+ case "System.Windows.Media.Animation.VectorKeyFrame[]":
+ {
+ System.Windows.Media.Animation.DiscreteVectorKeyFrame[] bkf = new System.Windows.Media.Animation.DiscreteVectorKeyFrame[1];
+ bkf[0] = new System.Windows.Media.Animation.DiscreteVectorKeyFrame();
+ return bkf;
+ }
+ case "System.Windows.Media.Animation.KeySpline":
+ {
+ return new System.Windows.Media.Animation.KeySpline(0.1, 0.2, 0.3, 0.4);
+ }
+
+ case "System.Windows.Media.Animation.KeyTime":
+ {
+ return System.Windows.Media.Animation.KeyTime.FromTimeSpan(new System.TimeSpan(0,0,0,0,4000));
+ }
+
+ case "System.Windows.Media.Animation.FillBehavior":
+ {
+ return System.Windows.Media.Animation.FillBehavior.Stop;
+ }
+
+ case "System.Windows.Media.Animation.PathAnimationSource":
+ {
+ return System.Windows.Media.Animation.PathAnimationSource.Angle;
+ }
+
+ case "System.Windows.Media.Animation.ParallelTimeline" :
+ {
+ return new System.Windows.Media.Animation.ParallelTimeline();
+ }
+
+ case "System.Windows.Media.Animation.PointAnimationBase":
+ {
+ return new PointModifier (new ModifierController (), 7.5, 13.2);
+ }
+
+ case "System.Windows.Media.Animation.SizeAnimationBase":
+ {
+ return new SizeModifier (new ModifierController (), 7.5, 13.2);
+ }
+ case "System.Windows.Media.Animation.BooleanAnimationBase":
+ {
+ return (firstOption) ? new BooleanModifier(new ModifierController(), true) : new BooleanModifier(new ModifierController(), false);
+ }
+ case "System.Windows.Media.Animation.ByteAnimationBase":
+ {
+ return new ByteModifier(new ModifierController(), Convert.ToByte("0", System.Globalization.CultureInfo.InvariantCulture));
+ }
+ case "System.Windows.Media.Animation.CharAnimationBase":
+ {
+ return new CharModifier(new ModifierController(), 'a');
+ }
+
+ case "System.Windows.Media.Animation.DecimalAnimationBase":
+ {
+ return new DecimalModifier(new ModifierController(), 7.5m);
+ }
+
+ case "System.Windows.Media.Animation.DoubleAnimationBase":
+ {
+ return new DoubleModifier (new ModifierController (), 7.5);
+ }
+ case "System.Windows.Media.Animation.SingleAnimationBase":
+ {
+ return new SingleModifier(new ModifierController(), 7.5f);
+ }
+
+ case "System.Windows.Media.Animation.Int32AnimationBase":
+ {
+ return new Int32Modifier(new ModifierController(), 1);
+ }
+ case "System.Windows.Media.Animation.Int64AnimationBase":
+ {
+ return new Int64Modifier(new ModifierController(), 1);
+ }
+ case "System.Windows.Media.Animation.Int16AnimationBase":
+ {
+ return new Int16Modifier(new ModifierController(), 1);
+ }
+ case "System.Windows.Media.Animation.ColorAnimationBase":
+ {
+ return new ColorModifier (new ModifierController (), 0.2f, 0.1f, 0.1f, 0.1f);
+ }
+ case "System.Windows.Media.Animation.MatrixAnimationBase":
+ {
+ return new MatrixModifier (new ModifierController (), 1.1, 0.2, 0.1, 2.0, 0.3, 0.4);
+ }
+ case "System.Windows.Media.Animation.RectAnimationBase":
+ {
+ return new RectModifier (new ModifierController (), 7.5, 13.2, 12.4, 66.7);
+ }
+ case "System.Windows.Media.Animation.SlipBehavior":
+ {
+ return System.Windows.Media.Animation.SlipBehavior.Grow;
+ }
+ case "System.Windows.Media.Animation.StringAnimationBase":
+ {
+ return new StringModifier(new ModifierController(), "a");
+ }
+ case "System.Windows.Media.Animation.VectorAnimationBase":
+ {
+ return new VectorModifier(new ModifierController(), 7.5, 13.2);
+ }
+ case "System.Windows.Media.Animation.Point3DAnimationBase":
+ {
+ return new Point3DModifier (new ModifierController (), 7.5, 13.2, 12.4);
+ }
+ case "System.Windows.Media.Animation.Timeline":
+ {
+ return new System.Windows.Media.Animation.DoubleAnimation();
+ }
+ case "System.Windows.Media.Animation.Timeline[]":
+ {
+ System.Windows.Media.Animation.Timeline[] timeline = new System.Windows.Media.Animation.Timeline[1];
+ timeline[0] = new System.Windows.Media.Animation.DoubleAnimation();
+ return timeline;
+ }
+ case "System.Windows.Media.Animation.Vector3DAnimationBase":
+ {
+ return new Vector3DModifier (new ModifierController (), 7.5, 13.2, 12.4);
+ }
+ case "System.Windows.Media.TextEffect":
+ {
+ return new System.Windows.Media.TextEffect();
+ }
+ case "System.Windows.Media.TextEffect[]":
+ {
+ System.Windows.Media.TextEffect [] retval = new System.Windows.Media.TextEffect[1];
+ retval[0] = new System.Windows.Media.TextEffect();
+ return retval;
+ }
+ case "System.Windows.Duration":
+ {
+ return (firstOption) ? new System.Windows.Duration(TimeSpan.FromSeconds(0)):new System.Windows.Duration(TimeSpan.FromSeconds(1));
+ }
+ case "System.Windows.Media.Media3D.Rotation3D":
+ {
+ return new System.Windows.Media.Media3D.AxisAngleRotation3D(new System.Windows.Media.Media3D.Vector3D(20, 30, 40), 50);
+ }
+ case "System.Windows.Media.Animation.RepeatBehavior":
+ {
+ return (firstOption) ? new System.Windows.Media.Animation.RepeatBehavior(TimeSpan.FromSeconds(1)):new System.Windows.Media.Animation.RepeatBehavior(2);
+ }
+ default:
+ {
+ GlobalLog.LogStatus ("************* Do not know how to make object for " + name);
+ return null;
+ }
+ }
+ }
+
+
+
+ //----------------------------------------------------------
+ public static System.Windows.Media.PathSegmentCollection MakePathSegmentCollection ()
+ {
+ System.Windows.Media.PathSegmentCollection retval = new System.Windows.Media.PathSegmentCollection ();
+
+ retval.Add (new System.Windows.Media.LineSegment (new System.Windows.Point (10.0, 20.0), false));
+ retval.Add (new System.Windows.Media.LineSegment (new System.Windows.Point (100.0, 20.0), true));
+ return retval;
+ }
+ //----------------------------------------------------------
+ public static System.Windows.Media.PointCollection MakePointCollection()
+ {
+ // 6 points will do both for PolyQuadratic and PolyCubic Beziers
+ System.Windows.Media.PointCollection retval = new System.Windows.Media.PointCollection();
+
+ retval.Add(new System.Windows.Point(0.0, 0.0));
+ retval.Add(new System.Windows.Point(10.0, 0.0));
+ retval.Add(new System.Windows.Point(0.0, 10.0));
+ retval.Add(new System.Windows.Point(0.0, 0.0));
+ retval.Add(new System.Windows.Point(10.0, 0.0));
+ retval.Add(new System.Windows.Point(0.0, 10.0));
+ return retval;
+ }
+
+ public static object MakeCollection (string name)
+ {
+ switch (name)
+ {
+ case "System.Windows.Media.Animation.BooleanKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteBooleanKeyFrame bokf = new System.Windows.Media.Animation.DiscreteBooleanKeyFrame();
+ System.Windows.Media.Animation.BooleanKeyFrameCollection retval = new System.Windows.Media.Animation.BooleanKeyFrameCollection();
+
+ retval.Add(bokf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.ByteKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteByteKeyFrame bykf = new System.Windows.Media.Animation.DiscreteByteKeyFrame();
+ System.Windows.Media.Animation.ByteKeyFrameCollection retval = new System.Windows.Media.Animation.ByteKeyFrameCollection();
+
+ retval.Add(bykf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.CharKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteCharKeyFrame chkf = new System.Windows.Media.Animation.DiscreteCharKeyFrame();
+ System.Windows.Media.Animation.CharKeyFrameCollection retval = new System.Windows.Media.Animation.CharKeyFrameCollection();
+
+ retval.Add(chkf);
+ return retval;
+ }
+ case "System.Windows.Media.Animation.ClockCollection":
+ {
+ System.Windows.Media.Animation.ParallelTimeline timeline = new System.Windows.Media.Animation.ParallelTimeline();
+ System.Windows.Media.Animation.ClockGroup cg = timeline.CreateClock();
+ System.Windows.Media.Animation.ClockCollection cc = cg.Children;
+ return cc;
+ }
+
+
+ case "System.Windows.Media.Animation.ColorKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteColorKeyFrame cokf = new System.Windows.Media.Animation.DiscreteColorKeyFrame();
+ System.Windows.Media.Animation.ColorKeyFrameCollection retval = new System.Windows.Media.Animation.ColorKeyFrameCollection();
+
+ retval.Add(cokf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.DecimalKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteDecimalKeyFrame dekf = new System.Windows.Media.Animation.DiscreteDecimalKeyFrame();
+ System.Windows.Media.Animation.DecimalKeyFrameCollection retval = new System.Windows.Media.Animation.DecimalKeyFrameCollection();
+
+ retval.Add(dekf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.DoubleKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteDoubleKeyFrame dukf = new System.Windows.Media.Animation.DiscreteDoubleKeyFrame();
+ System.Windows.Media.Animation.DoubleKeyFrameCollection retval = new System.Windows.Media.Animation.DoubleKeyFrameCollection();
+
+ retval.Add(dukf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.Int16KeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteInt16KeyFrame i16kf = new System.Windows.Media.Animation.DiscreteInt16KeyFrame();
+ System.Windows.Media.Animation.Int16KeyFrameCollection retval = new System.Windows.Media.Animation.Int16KeyFrameCollection();
+
+ retval.Add(i16kf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.Int32KeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteInt32KeyFrame i32kf = new System.Windows.Media.Animation.DiscreteInt32KeyFrame();
+ System.Windows.Media.Animation.Int32KeyFrameCollection retval = new System.Windows.Media.Animation.Int32KeyFrameCollection();
+
+ retval.Add(i32kf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.Int64KeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteInt64KeyFrame i64kf = new System.Windows.Media.Animation.DiscreteInt64KeyFrame();
+ System.Windows.Media.Animation.Int64KeyFrameCollection retval = new System.Windows.Media.Animation.Int64KeyFrameCollection();
+
+ retval.Add(i64kf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.MatrixKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteMatrixKeyFrame mkf = new System.Windows.Media.Animation.DiscreteMatrixKeyFrame();
+ System.Windows.Media.Animation.MatrixKeyFrameCollection retval = new System.Windows.Media.Animation.MatrixKeyFrameCollection();
+
+ retval.Add(mkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.ObjectKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteObjectKeyFrame okf = new System.Windows.Media.Animation.DiscreteObjectKeyFrame();
+ System.Windows.Media.Animation.ObjectKeyFrameCollection retval = new System.Windows.Media.Animation.ObjectKeyFrameCollection();
+
+ retval.Add(okf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.PointKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscretePointKeyFrame pkf = new System.Windows.Media.Animation.DiscretePointKeyFrame();
+ System.Windows.Media.Animation.PointKeyFrameCollection retval = new System.Windows.Media.Animation.PointKeyFrameCollection();
+
+ retval.Add(pkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.Point3DKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscretePoint3DKeyFrame p3dkf = new System.Windows.Media.Animation.DiscretePoint3DKeyFrame();
+ System.Windows.Media.Animation.Point3DKeyFrameCollection retval = new System.Windows.Media.Animation.Point3DKeyFrameCollection();
+
+ retval.Add(p3dkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.QuaternionKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteQuaternionKeyFrame qkf = new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame();
+ System.Windows.Media.Animation.QuaternionKeyFrameCollection retval = new System.Windows.Media.Animation.QuaternionKeyFrameCollection();
+
+ retval.Add(qkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.RectKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteRectKeyFrame rkf = new System.Windows.Media.Animation.DiscreteRectKeyFrame();
+ System.Windows.Media.Animation.RectKeyFrameCollection retval = new System.Windows.Media.Animation.RectKeyFrameCollection();
+
+ retval.Add(rkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.Rotation3DKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteRotation3DKeyFrame r3dkf = new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame();
+ System.Windows.Media.Animation.Rotation3DKeyFrameCollection retval = new System.Windows.Media.Animation.Rotation3DKeyFrameCollection();
+
+ retval.Add(r3dkf);
+ return retval;
+ }
+
+
+ case "System.Windows.Media.Animation.SingleKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteSingleKeyFrame sikf = new System.Windows.Media.Animation.DiscreteSingleKeyFrame();
+ System.Windows.Media.Animation.SingleKeyFrameCollection retval = new System.Windows.Media.Animation.SingleKeyFrameCollection();
+
+ retval.Add(sikf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.SizeKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteSizeKeyFrame szkf = new System.Windows.Media.Animation.DiscreteSizeKeyFrame();
+ System.Windows.Media.Animation.SizeKeyFrameCollection retval = new System.Windows.Media.Animation.SizeKeyFrameCollection();
+
+ retval.Add(szkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.StringKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteStringKeyFrame stkf = new System.Windows.Media.Animation.DiscreteStringKeyFrame();
+ System.Windows.Media.Animation.StringKeyFrameCollection retval = new System.Windows.Media.Animation.StringKeyFrameCollection();
+
+ retval.Add(stkf);
+ return retval;
+ }
+ case "System.Windows.Media.Animation.ThicknessKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteThicknessKeyFrame thkf = new System.Windows.Media.Animation.DiscreteThicknessKeyFrame();
+ System.Windows.Media.Animation.ThicknessKeyFrameCollection retval = new System.Windows.Media.Animation.ThicknessKeyFrameCollection();
+
+ retval.Add(thkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.TimelineCollection":
+ {
+ System.Windows.Media.Animation.ParallelTimeline ptl = new System.Windows.Media.Animation.ParallelTimeline();
+ System.Windows.Media.Animation.TimelineCollection retval = new System.Windows.Media.Animation.TimelineCollection();
+
+ retval.Add(ptl);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.VectorKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteVectorKeyFrame vkf = new System.Windows.Media.Animation.DiscreteVectorKeyFrame();
+ System.Windows.Media.Animation.VectorKeyFrameCollection retval = new System.Windows.Media.Animation.VectorKeyFrameCollection();
+
+ retval.Add(vkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.Animation.Vector3DKeyFrameCollection":
+ {
+ System.Windows.Media.Animation.DiscreteVector3DKeyFrame v3dkf = new System.Windows.Media.Animation.DiscreteVector3DKeyFrame(new System.Windows.Media.Media3D.Vector3D(1.0,2.0,3.0));
+ System.Windows.Media.Animation.Vector3DKeyFrameCollection retval = new System.Windows.Media.Animation.Vector3DKeyFrameCollection();
+
+ retval.Add(v3dkf);
+ return retval;
+ }
+
+ case "System.Windows.Media.DoubleCollection":
+ {
+ System.Windows.Media.DoubleCollection retval = new System.Windows.Media.DoubleCollection();
+ retval.Add(2.0);
+ return retval;
+ }
+ case "System.Windows.Media.Int32Collection":
+ {
+ System.Windows.Media.Int32Collection retval = new System.Windows.Media.Int32Collection();
+ retval.Add(1);
+ return retval;
+ }
+
+ case "System.Windows.Media.TransformCollection":
+ {
+ System.Windows.Media.TransformCollection retval = new System.Windows.Media.TransformCollection ();
+
+ retval.Add (new System.Windows.Media.TranslateTransform (17.0, 3.0));
+ retval.Add (new System.Windows.Media.RotateTransform (30.0));
+ return retval;
+ }
+
+ case "System.Windows.Media.GeometryGroup":
+ {
+ System.Windows.Media.GeometryGroup retval = new System.Windows.Media.GeometryGroup();
+ retval.Children.Add(new System.Windows.Media.EllipseGeometry(new System.Windows.Rect(10.0, 20.0, 150.0, 90.0)));
+ retval.Children.Add(new System.Windows.Media.EllipseGeometry(new System.Windows.Rect(20.0, 30.9, 150.1, 99.9)));
+ return retval;
+ }
+
+ case "System.Windows.Media.CombinedGeometry":
+ {
+ System.Windows.Media.CombinedGeometry retval = new System.Windows.Media.CombinedGeometry(
+ System.Windows.Media.GeometryCombineMode.Xor,
+ new System.Windows.Media.EllipseGeometry(new System.Windows.Rect(10.0, 20.0, 150.0, 90.0)),
+ new System.Windows.Media.EllipseGeometry(new System.Windows.Rect(20.0, 30.9, 150.1, 99.9)));
+ return retval;
+ }
+
+ case "System.Windows.Media.PathSegmentCollection":
+ {
+ return MakePathSegmentCollection ();
+ }
+
+ case "System.Windows.Media.PathFigure":
+ {
+ return MakePathSegmentCollection ();
+ }
+ case "System.Windows.Media.PathFigureCollection":
+ {
+ System.Windows.Media.PathFigureCollection retval = new System.Windows.Media.PathFigureCollection ();
+ retval.Add(new System.Windows.Media.PathFigure(new System.Windows.Point(0, 0), MakePathSegmentCollection(), false));
+ return retval;
+ }
+ case "System.Windows.Media.PathGeometry":
+ {
+ System.Windows.Media.PathFigureCollection retval = new System.Windows.Media.PathFigureCollection ();
+
+ retval.Add(new System.Windows.Media.PathFigure(new System.Windows.Point(0, 0), MakePathSegmentCollection(), false));
+ return retval;
+ }
+ case "System.Windows.Media.GradientStopCollection":
+ {
+ System.Windows.Media.GradientStopCollection retval = new System.Windows.Media.GradientStopCollection ();
+
+ retval.Add (new System.Windows.Media.GradientStop (System.Windows.Media.Color.FromScRgb (0.7f, 1.0f, 0.0f, 0.1f), 0.0));
+ retval.Add (new System.Windows.Media.GradientStop (System.Windows.Media.Color.FromScRgb (0.2f, 0.0f, 1.0f, 0.7f), 1.0));
+ return retval;
+ }
+ case "System.Windows.Media.Media3D.Model3DCollection":
+ {
+ System.Windows.Media.Media3D.Model3DCollection retval = new System.Windows.Media.Media3D.Model3DCollection();
+ // Model3D is an abstract class, so use AmbientLight instead
+ System.Windows.Media.Media3D.Model3D model3d = new System.Windows.Media.Media3D.AmbientLight();
+ retval.Add(model3d);
+ return retval;
+ }
+ case "System.Windows.Media.Media3D.Model3DGroup":
+ {
+ System.Windows.Media.Media3D.Model3D[] model3d = new System.Windows.Media.Media3D.Model3D[1];
+
+ model3d[0] = new System.Windows.Media.Media3D.AmbientLight();
+ System.Windows.Media.Media3D.Model3DGroup group = new System.Windows.Media.Media3D.Model3DGroup();
+ group.Children = new System.Windows.Media.Media3D.Model3DCollection( model3d );
+ return group;
+ }
+
+ case "System.Windows.Media.Media3D.Transform3DCollection":
+ {
+ System.Windows.Media.Media3D.Transform3D[] tx3d = new System.Windows.Media.Media3D.Transform3D[1];
+
+ tx3d[0] = new System.Windows.Media.Media3D.TranslateTransform3D(new System.Windows.Media.Media3D.Vector3D(10.0, 20.0, 3.0));
+ System.Windows.Media.Media3D.Transform3DCollection retval = new System.Windows.Media.Media3D.Transform3DCollection();
+ retval.Add(tx3d[0]);
+ return retval;
+ }
+ case "System.Windows.Media.Media3D.Transform3DGroup":
+ {
+ System.Windows.Media.Media3D.Transform3D [] tx3d = new System.Windows.Media.Media3D.Transform3D[1];
+
+ tx3d[0] = new System.Windows.Media.Media3D.TranslateTransform3D(new System.Windows.Media.Media3D.Vector3D(10.0, 20.0, 3.0));
+ System.Windows.Media.Media3D.Transform3DGroup group = new System.Windows.Media.Media3D.Transform3DGroup();
+ group.Children = new System.Windows.Media.Media3D.Transform3DCollection(tx3d);
+ return group;
+ }
+
+ // the below 3 cases can use the same data
+ case "System.Windows.Media.PolyBezierSegment":
+ case "System.Windows.Media.PolyLineSegment":
+ case "System.Windows.Media.PolyQuadraticBezierSegment":
+ {
+ System.Windows.Media.PointCollection retval = new System.Windows.Media.PointCollection();
+ retval.Add(new System.Windows.Point(0.0, 0.0));
+ retval.Add(new System.Windows.Point(10.0, 10.0));
+ retval.Add(new System.Windows.Point(100.0, 100.0));
+ retval.Add(new System.Windows.Point(50.0, 50.0));
+ retval.Add(new System.Windows.Point(110.0, 110.0));
+ retval.Add(new System.Windows.Point(150.0, 150.0));
+ return retval;
+ }
+ case "System.Windows.PointCollection":
+ {
+ return MakePointCollection();
+ }
+
+ case "System.Windows.Media.Media3D.Point3DCollection":
+ {
+ System.Windows.Media.Media3D.Point3DCollection retval = new System.Windows.Media.Media3D.Point3DCollection();
+ retval.Add(new System.Windows.Media.Media3D.Point3D(1.0, 2.0, 3.0));
+ return retval;
+ }
+
+ case "System.Windows.Media.TextEffectCollection":
+ {
+ System.Windows.Media.TextEffectCollection retval = new System.Windows.Media.TextEffectCollection();
+ System.Windows.Media.TextEffect te = new System.Windows.Media.TextEffect();
+ retval.Add(te);
+ return retval;
+ }
+
+ case "System.Windows.Media.Media3D.Vector3DCollection":
+ {
+ System.Windows.Media.Media3D.Vector3DCollection retval = new System.Windows.Media.Media3D.Vector3DCollection();
+ retval.Add(new System.Windows.Media.Media3D.Vector3D(100.0, 200.0, 3.0));
+ return retval;
+ }
+
+ case "System.Windows.Media.VectorCollection":
+ {
+ System.Windows.Media.VectorCollection retval = new System.Windows.Media.VectorCollection();
+ retval.Add(new System.Windows.Vector(1.2, 3.7));
+ return retval;
+ }
+
+ default:
+ {
+ GlobalLog.LogEvidence ("************* Do not know how to make object collection for " + name);
+ return null;
+ }
+ }
+ }
+ #endregion
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/RectModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/RectModifier.cs
new file mode 100644
index 000000000..4940c2082
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/RectModifier.cs
@@ -0,0 +1,104 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked RectModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class RectModifier : System.Windows.Media.Animation.RectAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public RectModifier ( ModifierController c, double dx, double dy, double dw, double dh )
+ {
+ _controller = c;
+ _deltaX = dx;
+ _deltaY = dy;
+ _deltaW = dw;
+ _deltaH = dh;
+ }
+ protected RectModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ RectModifier rectModifier = (RectModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = rectModifier._controller;
+ _deltaX = rectModifier._deltaX;
+ _deltaY = rectModifier._deltaY;
+ _deltaW = rectModifier._deltaW;
+ _deltaH = rectModifier._deltaH;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ RectModifier rectModifier = (RectModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = rectModifier._controller;
+ _deltaX = rectModifier._deltaX;
+ _deltaY = rectModifier._deltaY;
+ _deltaW = rectModifier._deltaW;
+ _deltaH = rectModifier._deltaH;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ RectModifier rectModifier = (RectModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = rectModifier._controller;
+ _deltaX = rectModifier._deltaX;
+ _deltaY = rectModifier._deltaY;
+ _deltaW = rectModifier._deltaW;
+ _deltaH = rectModifier._deltaH;
+
+ }
+ public new RectModifier GetAsFrozen()
+ {
+ return (RectModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new RectModifier();
+ }
+ //----------------------------------------------------------
+
+ protected override System.Windows.Rect
+ GetCurrentValueCore(System.Windows.Rect defaultOriginValue, System.Windows.Rect baseValue, System.Windows.Media.Animation.AnimationClock clock)
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return new System.Windows.Rect ( _deltaX, _deltaY, _deltaW, _deltaH );
+ }
+ else
+ {
+ return new System.Windows.Rect ( baseValue.X + _deltaX, baseValue.Y + _deltaY, baseValue.Width + _deltaW, baseValue.Height + _deltaH );
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _deltaX;
+ private double _deltaY;
+ private double _deltaW;
+ private double _deltaH;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ShortModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ShortModifier.cs
new file mode 100644
index 000000000..3de02a7d5
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/ShortModifier.cs
@@ -0,0 +1,88 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked Int16Modifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class Int16Modifier : System.Windows.Media.Animation.Int16AnimationBase
+ {
+ //----------------------------------------------------------
+
+ public Int16Modifier ( ModifierController c, short d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected Int16Modifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int16Modifier int16Modifier = (Int16Modifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = int16Modifier._controller;
+ _delta = int16Modifier._delta;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int16Modifier int16Modifier = (Int16Modifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = int16Modifier._controller;
+ _delta = int16Modifier._delta;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Int16Modifier int16Modifier = (Int16Modifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = int16Modifier._controller;
+ _delta = int16Modifier._delta;
+
+ }
+ public new Int16Modifier GetAsFrozen()
+ {
+ return (Int16Modifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new Int16Modifier();
+ }
+
+
+ protected override short GetCurrentValueCore ( short defaultOriginValue, short baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return (short)(baseValue + _delta);
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private short _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/SizeModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/SizeModifier.cs
new file mode 100644
index 000000000..76bb081a4
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/SizeModifier.cs
@@ -0,0 +1,91 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked SizeModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class SizeModifier : System.Windows.Media.Animation.SizeAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public SizeModifier ( ModifierController c, double dx, double dy )
+ {
+ _controller = c;
+ _deltaX = dx;
+ _deltaY = dy;
+ }
+
+ protected SizeModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ SizeModifier sizeModifier = (SizeModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = sizeModifier._controller;
+ _deltaX = sizeModifier._deltaX;
+ _deltaY = sizeModifier._deltaY;
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ SizeModifier sizeModifier = (SizeModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = sizeModifier._controller;
+ _deltaX = sizeModifier._deltaX;
+ _deltaY = sizeModifier._deltaY;
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ SizeModifier sizeModifier = (SizeModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = sizeModifier._controller;
+ _deltaX = sizeModifier._deltaX;
+ _deltaY = sizeModifier._deltaY;
+ }
+ public new SizeModifier GetAsFrozen()
+ {
+ return (SizeModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new SizeModifier();
+ }
+ protected override System.Windows.Size
+ GetCurrentValueCore ( System.Windows.Size defaultOriginValue, System.Windows.Size baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return new System.Windows.Size ( _deltaX, _deltaY );
+ }
+ else
+ {
+ return new System.Windows.Size ( baseValue.Width + _deltaX, baseValue.Height + _deltaY );
+ }
+ }
+
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _deltaX;
+ private double _deltaY;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/StringModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/StringModifier.cs
new file mode 100644
index 000000000..7c9b97a3e
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/StringModifier.cs
@@ -0,0 +1,88 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test-hooked StringModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class StringModifier : System.Windows.Media.Animation.StringAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public StringModifier ( ModifierController c, string d )
+ {
+ _controller = c;
+ _delta = d;
+ }
+ protected StringModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ StringModifier stringModifier = (StringModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = stringModifier._controller;
+ _delta = stringModifier._delta;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ StringModifier stringModifier = (StringModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = stringModifier._controller;
+ _delta = stringModifier._delta;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ StringModifier stringModifier = (StringModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = stringModifier._controller;
+ _delta = stringModifier._delta;
+
+ }
+ public new StringModifier GetAsFrozen()
+ {
+ return (StringModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new StringModifier();
+ }
+
+
+ protected override string GetCurrentValueCore(string defaultOriginValue, string baseValue, System.Windows.Media.Animation.AnimationClock clock )
+ {
+ if ( !_controller.UsesBaseValue )
+ {
+ return _delta;
+ }
+ else
+ {
+ return baseValue + _delta;
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private string _delta;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/TypeHelper.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/TypeHelper.cs
new file mode 100644
index 000000000..d7415d295
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/TypeHelper.cs
@@ -0,0 +1,90 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: TypeHelper Class
+
+ *
+ ************************************************************/
+
+using System;
+using System.Xml;
+using System.Reflection;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Objects
+{
+ //--------------------------------------------------------------
+
+ public class TypeHelper
+ {
+ public static bool IsDerivative(Type t, string name)
+ {
+ for (Type b = t.BaseType; b != null; b = b.BaseType)
+ {
+ if (b.ToString() == name)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ //----------------------------------------------------------
+ public static bool IsType(Type t, string checkedType)
+ {
+ return (t.ToString() == checkedType) ? true : false;
+ }
+
+ public static bool IsFreezable(Type t)
+ {
+ return IsDerivative(t, "System.Windows.Freezable");
+ }
+
+ public static bool IsDependencyObject(Type t)
+ {
+ return IsDerivative(t, "System.Windows.DependencyObject");
+ }
+
+ public static bool IsMediaTimeline(Type t)
+ {
+ return (IsDerivative (t, "System.Windows.Media.MediaTimeline") || (t.ToString() == "System.Windows.Media.MediaTimeline"));
+ }
+ public static bool IsMedia3D(Type t)
+ {
+ return (t.ToString().StartsWith("System.Windows.Media.Media3D"));
+ }
+
+ public static bool IsAnimatable(Type t)
+ {
+ return IsDerivative(t, "System.Windows.Media.Animation.Animatable");
+ }
+
+ public static bool IsAnimationCollection(Type t)
+ {
+ return IsDerivative(t, "System.Windows.Media.Animation.AnimationCollection");
+ }
+
+ // returns true if there are embedded freezable types; false otherwise
+ public static bool IsComplexChangeable(Type t)
+ {
+ // get the type's fields
+ System.Reflection.FieldInfo[] fi = t.GetFields (BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static);
+
+ for (int i = 0; i < fi.Length; i++)
+ {
+ // check if any of the members are changeables
+ if (IsFreezable (fi[i].FieldType))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/Vector3DModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/Vector3DModifier.cs
new file mode 100644
index 000000000..7fc2d1054
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/Vector3DModifier.cs
@@ -0,0 +1,97 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked Vector3DModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+ //--------------------------------------------------------------
+ // The Freezable pattern is horribly violated by this class but I don't care
+ // since I am not testing interaction with Freezable yet.
+
+ public class Vector3DModifier : System.Windows.Media.Animation.Vector3DAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public Vector3DModifier ( ModifierController c, double dx, double dy, double dz )
+ {
+ _controller = c;
+ _deltaX = dx;
+ _deltaY = dy;
+ _deltaZ = dz;
+ }
+
+ protected Vector3DModifier()
+ {
+ }
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ Vector3DModifier vector3DModifier = (Vector3DModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = vector3DModifier._controller;
+ _deltaX = vector3DModifier._deltaX;
+ _deltaY = vector3DModifier._deltaY;
+ _deltaZ = vector3DModifier._deltaZ;
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Vector3DModifier vector3DModifier = (Vector3DModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = vector3DModifier._controller;
+ _deltaX = vector3DModifier._deltaX;
+ _deltaY = vector3DModifier._deltaY;
+ _deltaZ = vector3DModifier._deltaZ;
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ Vector3DModifier vector3DModifier = (Vector3DModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = vector3DModifier._controller;
+ _deltaX = vector3DModifier._deltaX;
+ _deltaY = vector3DModifier._deltaY;
+ _deltaZ = vector3DModifier._deltaZ;
+ }
+ public new Vector3DModifier GetAsFrozen()
+ {
+ return (Vector3DModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new Vector3DModifier();
+ }
+
+
+ protected override System.Windows.Media.Media3D.Vector3D
+ GetCurrentValueCore(System.Windows.Media.Media3D.Vector3D defaultOriginValue, System.Windows.Media.Media3D.Vector3D baseValue, System.Windows.Media.Animation.AnimationClock clock)
+ {
+ if (!_controller.UsesBaseValue)
+ {
+ return new System.Windows.Media.Media3D.Vector3D ( _deltaX, _deltaY, _deltaZ );
+ }
+ else
+ {
+ return new System.Windows.Media.Media3D.Vector3D ( baseValue.X + _deltaX, baseValue.Y + _deltaY, baseValue.Z + _deltaZ );
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _deltaX;
+ private double _deltaY;
+ private double _deltaZ;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/VectorModifier.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/VectorModifier.cs
new file mode 100644
index 000000000..7b6031b2f
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/PredefinedObjects/VectorModifier.cs
@@ -0,0 +1,95 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2003
+ *
+ * Program: Test-hooked VectorModifier
+
+ *
+ ************************************************************/
+
+using System;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Modifiers
+{
+
+ public class VectorModifier : System.Windows.Media.Animation.VectorAnimationBase
+ {
+ //----------------------------------------------------------
+
+ public VectorModifier ( ModifierController c, double x, double y )
+ {
+ _controller = c;
+ _x = x;
+ _y = y;
+ }
+
+ protected VectorModifier()
+ {
+ }
+
+
+ //----------------------------------------------------------
+ protected override void CloneCore(System.Windows.Freezable sourceFreezable)
+ {
+ VectorModifier vectorModifier = (VectorModifier)sourceFreezable;
+ base.CloneCore(sourceFreezable);
+ _controller = vectorModifier._controller;
+ _x = vectorModifier._x;
+ _y = vectorModifier._y;
+
+ }
+ protected override void GetAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ VectorModifier vectorModifier = (VectorModifier)sourceFreezable;
+ base.GetAsFrozenCore(sourceFreezable);
+ _controller = vectorModifier._controller;
+ _x = vectorModifier._x;
+ _y = vectorModifier._y;
+
+ }
+ protected override void GetCurrentValueAsFrozenCore(System.Windows.Freezable sourceFreezable)
+ {
+ VectorModifier vectorModifier = (VectorModifier)sourceFreezable;
+ base.GetCurrentValueAsFrozenCore(sourceFreezable);
+ _controller = vectorModifier._controller;
+ _x = vectorModifier._x;
+ _y = vectorModifier._y;
+
+ }
+ public new VectorModifier GetAsFrozen()
+ {
+ return (VectorModifier)base.GetAsFrozen();
+ }
+ protected override System.Windows.Freezable CreateInstanceCore()
+ {
+ return new VectorModifier();
+ }
+
+
+ //----------------------------------------------------------
+
+ protected override System.Windows.Vector
+ GetCurrentValueCore(System.Windows.Vector defaultOriginValue, System.Windows.Vector baseValue, System.Windows.Media.Animation.AnimationClock clock)
+ {
+ if (!_controller.UsesBaseValue)
+ {
+ return new System.Windows.Vector ( _x, _y );
+ }
+ else
+ {
+ return new System.Windows.Vector ( baseValue.X + _x, baseValue.Y + _y );
+ }
+ }
+
+ //----------------------------------------------------------
+
+ private ModifierController _controller;
+ private double _x;
+ private double _y;
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Common/Utils/Result.cs b/src/Test/ElementServices/FeatureTests/Freezables/Common/Utils/Result.cs
new file mode 100644
index 000000000..9cd52bfa4
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Common/Utils/Result.cs
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2007
+ *
+ * Program: Result class
+ * Author:
+ *
+ ************************************************************/
+
+using System;
+using System.Windows;
+using System.Collections.Specialized;
+
+
+namespace Microsoft.Test.ElementServices.Freezables.Utils
+{
+ /******************************************************************************
+ * CLASS: Result
+ ******************************************************************************/
+ public class Result
+ {
+ #region Result
+
+ public Result()
+ {
+ failures = new StringCollection ();
+ passed = true;
+ }
+
+ public StringCollection failures;
+ public bool passed;
+
+ #endregion
+ }
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Data/25DPI.jpg b/src/Test/ElementServices/FeatureTests/Freezables/Data/25DPI.jpg
new file mode 100644
index 000000000..552a15add
Binary files /dev/null and b/src/Test/ElementServices/FeatureTests/Freezables/Data/25DPI.jpg differ
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Data/BORG.jpg b/src/Test/ElementServices/FeatureTests/Freezables/Data/BORG.jpg
new file mode 100644
index 000000000..b24e6df0b
Binary files /dev/null and b/src/Test/ElementServices/FeatureTests/Freezables/Data/BORG.jpg differ
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Data/FreezablesBVT.xtc b/src/Test/ElementServices/FeatureTests/Freezables/Data/FreezablesBVT.xtc
new file mode 100644
index 000000000..5612d0ad0
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Data/FreezablesBVT.xtc
@@ -0,0 +1,168 @@
+
+System.Windows.Media.Animation.Animatable
+System.Windows.Media.Animation.KeySpline
+System.Windows.Media.Animation.DoubleAnimationBase
+System.Windows.Media.Animation.DoubleAnimationUsingPath
+System.Windows.Media.Animation.MatrixAnimationBase
+System.Windows.Media.Animation.MatrixAnimationUsingPath
+System.Windows.Media.Animation.PointAnimationBase
+System.Windows.Media.Animation.PointAnimationUsingPath
+System.Windows.Media.PathSegment
+System.Windows.Media.ArcSegment
+System.Windows.Media.BezierSegment
+System.Windows.Media.Brush
+System.Windows.Media.CombinedGeometry
+System.Windows.Media.Imaging.BitmapSource
+System.Windows.Media.Drawing
+System.Windows.Media.TileBrush
+System.Windows.Media.DrawingBrush
+System.Windows.Media.Geometry
+System.Windows.Media.EllipseGeometry
+System.Windows.Media.DoubleCollection
+System.Windows.Media.GeometryGroup
+System.Windows.Media.GradientBrush
+System.Windows.Media.GradientStop
+System.Windows.Media.GradientStopCollection
+System.Windows.Media.LinearGradientBrush
+System.Windows.Media.LineGeometry
+System.Windows.Media.LineSegment
+System.Windows.Media.Transform
+System.Windows.Media.MatrixTransform
+System.Windows.Media.PathFigure
+System.Windows.Media.PathFigureCollection
+System.Windows.Media.PathGeometry
+System.Windows.Media.PathSegmentCollection
+System.Windows.Media.Pen
+System.Windows.Media.PointCollection
+System.Windows.Media.PolyBezierSegment
+System.Windows.Media.PolyLineSegment
+System.Windows.Media.PolyQuadraticBezierSegment
+System.Windows.Media.QuadraticBezierSegment
+System.Windows.Media.RadialGradientBrush
+System.Windows.Media.RectangleGeometry
+System.Windows.Media.RotateTransform
+System.Windows.Media.ScaleTransform
+System.Windows.Media.SkewTransform
+System.Windows.Media.SolidColorBrush
+System.Windows.Media.TextEffect
+System.Windows.Media.TextEffectCollection
+System.Windows.Media.TransformGroup
+System.Windows.Media.TransformCollection
+System.Windows.Media.TranslateTransform
+System.Windows.Media.VectorCollection
+System.Windows.Media.Media3D.Point3DCollection
+System.Windows.Media.Media3D.Vector3DCollection
+System.Windows.Media.Animation.ColorAnimationBase
+System.Windows.Media.Animation.DecimalAnimationBase
+System.Windows.Media.Animation.Int16AnimationBase
+System.Windows.Media.Animation.Int64AnimationBase
+System.Windows.Media.Animation.Point3DAnimationBase
+System.Windows.Media.Animation.RectAnimationBase
+System.Windows.Media.Animation.SingleAnimationBase
+System.Windows.Media.Animation.SizeAnimationBase
+System.Windows.Media.Animation.VectorAnimationBase
+System.Windows.Media.Animation.Vector3DAnimationBase
+System.Windows.Media.Animation.DiscreteBooleanKeyFrame
+System.Windows.Media.Animation.ByteKeyFrame
+System.Windows.Media.Animation.DiscreteByteKeyFrame
+System.Windows.Media.Animation.CharKeyFrame
+System.Windows.Media.Animation.DiscreteCharKeyFrame
+System.Windows.Media.Animation.ColorKeyFrame
+System.Windows.Media.Animation.DiscreteColorKeyFrame
+System.Windows.Media.Animation.DecimalKeyFrame
+System.Windows.Media.Animation.DiscreteDecimalKeyFrame
+System.Windows.Media.Animation.DoubleKeyFrame
+System.Windows.Media.Animation.DiscreteDoubleKeyFrame
+System.Windows.Media.Animation.Int16KeyFrame
+System.Windows.Media.Animation.DiscreteInt16KeyFrame
+System.Windows.Media.Animation.Int32KeyFrame
+System.Windows.Media.Animation.DiscreteInt32KeyFrame
+System.Windows.Media.Animation.Int64KeyFrame
+System.Windows.Media.Animation.DiscreteInt64KeyFrame
+System.Windows.Media.Animation.MatrixKeyFrame
+System.Windows.Media.Animation.DiscreteMatrixKeyFrame
+System.Windows.Media.Animation.PointKeyFrame
+System.Windows.Media.Animation.DiscretePointKeyFrame
+System.Windows.Media.Animation.Point3DKeyFrame
+System.Windows.Media.Animation.DiscretePoint3DKeyFrame
+System.Windows.Media.Animation.RectKeyFrame
+System.Windows.Media.Animation.DiscreteRectKeyFrame
+System.Windows.Media.Animation.SingleKeyFrame
+System.Windows.Media.Animation.DiscreteSingleKeyFrame
+System.Windows.Media.Animation.SizeKeyFrame
+System.Windows.Media.Animation.DiscreteSizeKeyFrame
+System.Windows.Media.Animation.StringKeyFrame
+System.Windows.Media.Animation.DiscreteStringKeyFrame
+System.Windows.Media.Animation.VectorKeyFrame
+System.Windows.Media.Animation.DiscreteVectorKeyFrame
+System.Windows.Media.Animation.Vector3DKeyFrame
+System.Windows.Media.Animation.DiscreteVector3DKeyFrame
+System.Windows.Media.Animation.BooleanAnimationBase
+System.Windows.Media.Animation.BooleanAnimationUsingKeyFrames
+System.Windows.Media.Animation.ByteAnimationUsingKeyFrames
+System.Windows.Media.Animation.CharAnimationBase
+System.Windows.Media.Animation.CharAnimationUsingKeyFrames
+System.Windows.Media.Animation.ColorAnimationUsingKeyFrames
+System.Windows.Media.Animation.DecimalAnimationUsingKeyFrames
+System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames
+System.Windows.Media.Animation.Int16AnimationUsingKeyFrames
+System.Windows.Media.Animation.Int32AnimationUsingKeyFrames
+System.Windows.Media.Animation.Int64AnimationUsingKeyFrames
+System.Windows.Media.Animation.MatrixAnimationUsingKeyFrames
+System.Windows.Media.Animation.PointAnimationUsingKeyFrames
+System.Windows.Media.Animation.Point3DAnimationUsingKeyFrames
+System.Windows.Media.Animation.RectAnimationUsingKeyFrames
+System.Windows.Media.Animation.SingleAnimationUsingKeyFrames
+System.Windows.Media.Animation.SizeAnimationUsingKeyFrames
+System.Windows.Media.Animation.StringAnimationBase
+System.Windows.Media.Animation.StringAnimationUsingKeyFrames
+System.Windows.Media.Animation.VectorAnimationUsingKeyFrames
+System.Windows.Media.Animation.Vector3DAnimationUsingKeyFrames
+System.Windows.Media.Animation.BooleanKeyFrameCollection
+System.Windows.Media.Animation.ByteKeyFrameCollection
+System.Windows.Media.Animation.CharKeyFrameCollection
+System.Windows.Media.Animation.ColorKeyFrameCollection
+System.Windows.Media.Animation.DecimalKeyFrameCollection
+System.Windows.Media.Animation.DoubleKeyFrameCollection
+System.Windows.Media.Animation.Int16KeyFrameCollection
+System.Windows.Media.Animation.Int32KeyFrameCollection
+System.Windows.Media.Animation.Int64KeyFrameCollection
+System.Windows.Media.Animation.MatrixKeyFrameCollection
+System.Windows.Media.Animation.PointKeyFrameCollection
+System.Windows.Media.Animation.Point3DKeyFrameCollection
+System.Windows.Media.Animation.RectKeyFrameCollection
+System.Windows.Media.Animation.SingleKeyFrameCollection
+System.Windows.Media.Animation.SizeKeyFrameCollection
+System.Windows.Media.Animation.StringKeyFrameCollection
+System.Windows.Media.Animation.VectorKeyFrameCollection
+System.Windows.Media.Animation.Vector3DKeyFrameCollection
+System.Windows.Media.Animation.LinearByteKeyFrame
+System.Windows.Media.Animation.LinearColorKeyFrame
+System.Windows.Media.Animation.LinearDecimalKeyFrame
+System.Windows.Media.Animation.LinearDoubleKeyFrame
+System.Windows.Media.Animation.LinearInt16KeyFrame
+System.Windows.Media.Animation.LinearInt32KeyFrame
+System.Windows.Media.Animation.LinearInt64KeyFrame
+System.Windows.Media.Animation.LinearPointKeyFrame
+System.Windows.Media.Animation.LinearPoint3DKeyFrame
+System.Windows.Media.Animation.LinearRectKeyFrame
+System.Windows.Media.Animation.LinearSingleKeyFrame
+System.Windows.Media.Animation.LinearSizeKeyFrame
+System.Windows.Media.Animation.LinearVectorKeyFrame
+System.Windows.Media.Animation.LinearVector3DKeyFrame
+System.Windows.Media.Animation.SplineByteKeyFrame
+System.Windows.Media.Animation.SplineColorKeyFrame
+System.Windows.Media.Animation.SplineDecimalKeyFrame
+System.Windows.Media.Animation.SplineDoubleKeyFrame
+System.Windows.Media.Animation.SplineInt16KeyFrame
+System.Windows.Media.Animation.SplineInt32KeyFrame
+System.Windows.Media.Animation.SplineInt64KeyFrame
+System.Windows.Media.Animation.SplinePointKeyFrame
+System.Windows.Media.Animation.SplinePoint3DKeyFrame
+System.Windows.Media.Animation.SplineRectKeyFrame
+System.Windows.Media.Animation.SplineSingleKeyFrame
+System.Windows.Media.Animation.SplineSizeKeyFrame
+System.Windows.Media.Animation.SplineVectorKeyFrame
+System.Windows.Media.Animation.SplineVector3DKeyFrame
+
+
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Data/FreezablesPatterns.xtc b/src/Test/ElementServices/FeatureTests/Freezables/Data/FreezablesPatterns.xtc
new file mode 100644
index 000000000..720eecba9
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Data/FreezablesPatterns.xtc
@@ -0,0 +1,561 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Data/PropertiesToSkip.xml b/src/Test/ElementServices/FeatureTests/Freezables/Data/PropertiesToSkip.xml
new file mode 100644
index 000000000..80d0ebd0a
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Data/PropertiesToSkip.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/Data/insertrect.xml b/src/Test/ElementServices/FeatureTests/Freezables/Data/insertrect.xml
new file mode 100644
index 000000000..c1b8c7171
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/Data/insertrect.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/FreezablesBVT/FreezablesBVT.cs b/src/Test/ElementServices/FeatureTests/Freezables/FreezablesBVT/FreezablesBVT.cs
new file mode 100644
index 000000000..d562c35a9
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/FreezablesBVT/FreezablesBVT.cs
@@ -0,0 +1,418 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2004
+ *
+ * Program: Test freezable object
+
+ *
+ ************************************************************/
+
+using System;
+using System.Reflection;
+using System.Collections.Specialized;
+using System.Windows;
+using System.Xml;
+
+using Microsoft.Test;
+using Microsoft.Test.Logging;
+using Microsoft.Test.TestTypes;
+using Microsoft.Test.Discovery;
+using Microsoft.Test.ElementServices.Freezables.Objects;
+
+
+namespace Microsoft.Test.ElementServices.Freezables
+{
+ ///
+ /// ElementServices\Freezables\BVT
+
+ /// 0
+ ///
+ /// BVT tests for Freezables
+ ///
+ ///
+
+ [Test(0, "Freezables.BVT", "FreezablesBVT", SupportFiles=@"FeatureTests\ElementServices\FreezablesBVT.xtc")]
+
+ /**********************************************************************************
+ * CLASS: FreezablesBVT
+ **********************************************************************************/
+ public class FreezablesBVT : AvalonTest
+ {
+ #region Test case members
+
+ private bool _passed;
+ private StringCollection _failures;
+ private string _testName = "";
+ private string _xtcFileName = "";
+
+ #endregion
+
+
+ #region Constructor
+
+ [Variation("TestCopy", "FreezablesBVT.xtc", Keywords = "MicroSuite")]
+ [Variation("TestIsFreezable", "FreezablesBVT.xtc")]
+ [Variation("TestMakeUnfreezable", "FreezablesBVT.xtc", Keywords = "MicroSuite")]
+
+
+ /******************************************************************************
+ * Function: FreezablesBVT Constructor
+ ******************************************************************************/
+ // Input Parameters:
+ // FreezablesBVT.exe assembly TestName ScriptName
+ // (note: don't specify .dll in assembly)
+ // e.g.,: FreezablesBVT.exe PresentationCore TestCopy FreezablesBVT.xtc
+ public FreezablesBVT(string inputValue0, string inputValue1)
+ {
+ _testName = inputValue0;
+ _xtcFileName = inputValue1;
+ InitializeSteps += new TestStep(Initialize);
+ RunSteps += new TestStep(StartTestCase);
+ RunSteps += new TestStep(Verify);
+ }
+
+ #endregion
+
+
+ #region Private Members
+
+ /******************************************************************************
+ * Function: Initialize
+ ******************************************************************************/
+ ///
+ /// Sets global variables.
+ ///
+ /// Returns TestResult=True
+ private TestResult Initialize()
+ {
+ _failures = new StringCollection();
+ _passed = true;
+
+ return TestResult.Pass;
+ }
+
+ /******************************************************************************
+ * Function: StartTestCase
+ ******************************************************************************/
+ ///
+ /// Carries out a series of basic Freezables tests. A global variable tracks pass/fail.
+ ///
+ /// Returns TestResult=True
+ private TestResult StartTestCase()
+ {
+ XmlDocument doc = new XmlDocument();
+
+ try
+ {
+ doc.Load(_xtcFileName);
+ }
+ catch (Exception)
+ {
+ throw new ApplicationException("Unable to load script file:" + _xtcFileName);
+ }
+
+ XmlElement changeableTest = (XmlElement)doc["FreezablesTest"];
+ if (changeableTest == null)
+ {
+ throw new ApplicationException("The script needs FreezablesTest element");
+ }
+ for (XmlNode classNode = changeableTest["ClassName"]; classNode != null; classNode = classNode.NextSibling)
+ {
+ Assembly dll = typeof(UIElement).Assembly;
+ Type t = dll.GetType(classNode.InnerText);
+
+ if (t == null)
+ {
+ _passed &= false;
+ _failures.Add(classNode.InnerText + ": invalid class in FreezablesBVT");
+ GlobalLog.LogEvidence("FAIL:" + classNode.InnerText + "invalid class in Freezable.xtc");
+ }
+ else
+ {
+ Test(t, _testName);
+ }
+ }
+
+ return TestResult.Pass;
+ }
+
+ /******************************************************************************
+ * Function: Test
+ ******************************************************************************/
+ ///
+ /// Invoke the specific test case requested.
+ ///
+ /// The Type of the Freezable object to be tested.
+ /// Name of the test to be executed.
+ ///
+ private void Test(Type t, string TestName)
+ {
+ if (TypeHelper.IsMediaTimeline (t))
+ { // skip media data objects testing for now
+ //
+ return;
+ }
+ if (TypeHelper.IsMedia3D(t))
+ { // skip Media3D objects testing for now
+ //
+ return;
+ }
+
+ GlobalLog.LogEvidence(t.ToString ());
+
+ switch (TestName)
+ {
+ case "TestCopy":
+ TestCopy(t);
+ break;
+
+ case "TestIsFreezable":
+ TestIsFreezable(t);
+ break;
+
+ case "TestMakeUnfreezable":
+ TestMakeUnfreezable(t);
+ break;
+
+ default:
+ throw new ApplicationException("Unknown TestName: " + TestName);
+ }
+ }
+
+ /******************************************************************************
+ * Function: CreateNewFreezable
+ ******************************************************************************/
+ ///
+ /// Obtain a Freezable.
+ ///
+ /// The Type of the Freezable object to be tested.
+ /// an instance of the specified type
+ private System.Windows.Freezable CreateNewFreezable(Type t)
+ {
+ if (t.IsAbstract)
+ {
+ return null;
+ }
+
+ System.Windows.Freezable retval = null;
+ ConstructorInfo[] ci = t.GetConstructors();
+
+ // for each constructor
+ for (int i = 0; i < ci.Length; i++)
+ {
+ try
+ {
+ ParameterInfo[] pi = ci[i].GetParameters();
+ Object[] objects = new Object[pi.Length]; // the constructor arguments
+
+ // for each parameter
+ for (int j = 0; j < pi.Length; j++)
+ {
+ if (j == pi[j].Position) // verify the position of the arguments
+ {
+ if (pi[j].ParameterType.FullName.ToString () == "System.Collections.ICollection"
+ || pi[j].ParameterType.FullName.StartsWith("System.Collections.Generic.IEnumerable"))
+ {
+ objects[j] = PredefinedObjects.MakeCollection (t.FullName.ToString ());
+ if (objects[j] == null)
+ {
+ return null;
+ }
+
+ }
+ else
+ {
+ objects[j] = PredefinedObjects.MakeValue (pi[j].ParameterType);
+ }
+ }
+ }
+
+ MakeObjectIfSpecialCase(t, pi, objects);
+ System.Windows.Freezable obj = (System.Windows.Freezable)t.InvokeMember (null, BindingFlags.Public | BindingFlags.Instance | BindingFlags.CreateInstance, null, null, objects);
+
+ if (obj != null)
+ {
+ retval = obj;
+ }
+ }
+ catch (System.Reflection.TargetInvocationException e)
+ {
+ if (!e.InnerException.ToString ().StartsWith ("System.ArgumentNullException"))
+ {
+ GlobalLog.LogEvidence(" !!! NewObject: Exception: {0}", e.InnerException.ToString ());
+ }
+
+ return null;
+ }
+ }
+ return retval;
+ }
+
+
+ /******************************************************************************
+ * Function: MakeObjectIfSpecialCase
+ ******************************************************************************/
+ ///
+ /// Create a Freezable object for special-case types.
+ ///
+ /// The Type of the Freezable object to be tested.
+ /// Parameter values.
+ /// Array of objects.
+ ///
+ private void MakeObjectIfSpecialCase(Type t, ParameterInfo[] pi, Object[] objects)
+ {
+ if (t.ToString() == "System.Windows.Media.Imaging.BitmapImage" && pi.Length == 10)
+ {
+ // The 8th parameter (stride) of BitmapImage constructor needs value stride = Width * BytePerPixel
+ // Ctor forImageData:
+ // (Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat, BitmapPalette imagePalette, Byte[] pixels, Int32 stride, Int32Rect sourceRect, BitmapSizeOptions sizeOptions)
+ System.Windows.Media.PixelFormat p = (System.Windows.Media.PixelFormat)objects[4];
+ objects[6] = new byte[32];
+ objects[7] = (Int32)objects[0] * p.BitsPerPixel / 8;
+ }
+ else if (t.ToString() == "System.Windows.Media.Animation.KeySpline" && pi.Length == 2 && pi[0].ParameterType.FullName.ToString() == "System.Windows.Point" && pi[1].ParameterType.FullName.ToString() == "System.Windows.Point")
+ {
+ // For Keyspline, points must be betwen 0.0 and 1.0
+ objects[0] = new Point(0.1, 0.2);
+ objects[1] = new Point(0.2, 0.7);
+
+ }
+ else if (t.ToString() == "System.Windows.Media.Animation.Setter" && pi.Length == 3)
+ {
+ // For animation Setter, generic objects from PredefinesObject will not work.
+ objects[0] = new System.Windows.Media.LineGeometry(new Point(10, 10), new Point(20, 20)); //DependencyObject();
+ objects[1] = System.Windows.Media.LineGeometry.StartPointProperty;
+ objects[2] = new System.Windows.Point(1.0, 2.0);
+ }
+ }
+
+
+ /******************************************************************************
+ * Function: TestIsFreezable
+ ******************************************************************************/
+ ///
+ /// Verify a Freezable object's IsFrozen property.
+ ///
+ /// The Type of the Freezable object tested.
+ ///
+ private void TestIsFreezable(Type t)
+ {
+ Freezable obj = CreateNewFreezable(t);
+
+ if (obj != null)
+ {
+ // Test !IsFrozen property
+ if (obj.IsFrozen)
+ {
+ _passed &= false;
+ _failures.Add(t.ToString() + ": !IsFrozen is false");
+ GlobalLog.LogEvidence("FAIL:" + t.ToString() + " !IsFrozen is false, expected true");
+ }
+ }
+ }
+
+
+ /******************************************************************************
+ * Function: TestMakeUnfreezable
+ ******************************************************************************/
+ ///
+ /// Verify a Freezable object's IsFrozen property, after freezing it.
+ ///
+ /// The Type of the Freezable object tested.
+ ///
+ private void TestMakeUnfreezable(Type t)
+ {
+ // create an instance of this type
+ Freezable obj = CreateNewFreezable(t);
+
+ if (obj != null && obj.CanFreeze)
+ {
+ obj.Freeze();
+
+ // Verify that !IsFrozen is false
+ if (!obj.IsFrozen)
+ {
+ _passed &= false;
+ _failures.Add(t.ToString() + ": !IsFrozen is true, expected false");
+ GlobalLog.LogEvidence("FAIL:" + t.ToString() + " !IsFrozen true, expected false");
+ }
+ }
+ }
+
+
+ /******************************************************************************
+ * Function: TestCopy
+ ******************************************************************************/
+ ///
+ /// Verify a Freezable object's IsFrozen property, after cloning it.
+ ///
+ /// The Type of the Freezable object tested.
+ ///
+ private void TestCopy(System.Type t)
+ {
+ //
+ if (t.ToString() == "System.Windows.Media.Imaging.BitmapSource+BitmapSourceNull")
+ {
+ //
+ return;
+ }
+
+ // create an instance of this type
+ Freezable obj = CreateNewFreezable(t);
+
+ if (obj!= null)
+ {
+ Freezable objCopy = obj.Clone() ;
+ if (objCopy.IsFrozen)
+ {
+ _passed &= false;
+ _failures.Add(t.ToString() + ": !IsFrozen is true, expeced false");
+ GlobalLog.LogEvidence("FAIL:" + t.ToString() + " !IsFrozen true, expected false");
+ }
+ // Skip Animation classes since
+ if (TypeHelper.IsAnimatable(t) || TypeHelper.IsAnimationCollection(t))
+ {
+ return;
+ }
+ }
+ }
+
+
+ /******************************************************************************
+ * Function: Verify
+ ******************************************************************************/
+ ///
+ /// Returns a Pass/Fail result for the test case.
+ ///
+ /// A TestResult, indicating whether the test passes or fails.
+ private TestResult Verify()
+ {
+ // report the failures all together
+ if (!_passed)
+ {
+ GlobalLog.LogEvidence("-------------------------------------------------");
+ GlobalLog.LogEvidence("FAILURE REPORT");
+ for (int i = 0; i < _failures.Count; i++)
+ {
+ GlobalLog.LogEvidence (_failures[i]);
+ }
+ }
+
+ if (_passed)
+ {
+ return TestResult.Pass;
+ }
+ else
+ {
+ return TestResult.Fail;
+ }
+ }
+
+ #endregion
+ }
+
+}
diff --git a/src/Test/ElementServices/FeatureTests/Freezables/FreezablesCollections/BrushCollectionTest.cs b/src/Test/ElementServices/FeatureTests/Freezables/FreezablesCollections/BrushCollectionTest.cs
new file mode 100644
index 000000000..28ad079d4
--- /dev/null
+++ b/src/Test/ElementServices/FeatureTests/Freezables/FreezablesCollections/BrushCollectionTest.cs
@@ -0,0 +1,134 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/***********************************************************
+ *
+ * Copyright (c) Microsoft Corporation, 2006
+ *
+ * Program: BrusheCollection Test
+
+ *
+ ************************************************************/
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Windows;
+using System.Windows.Media;
+using System.Windows.Media.Media3D;
+using System.Windows.Controls;
+using System.Windows.Data;
+
+using Microsoft.Test;
+using Microsoft.Test.Logging;
+using Microsoft.Test.ElementServices.Freezables.Utils;
+
+
+namespace Microsoft.Test.ElementServices.Freezables
+{
+
+ internal class BrushCollectionTest : FreezableCollectionTest
+ {
+ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ internal BrushCollectionTest()
+ {
+ _bogusCollection = new List