コード例 #1
0
 public void Deserialize()
 {
     var s = new CustomCommandSerializer().Serialize("White.NonCoreTests.CustomCommands.dll", "IBazCommand", "Foo", new object[] {"bar", 1});
     ICommand customCommand;
     bool result = new CommandSerializer(new CommandAssemblies()).TryDeserializeCommand(s, out customCommand);
     Assert.AreEqual(true, result);
 }
コード例 #2
0
ファイル: WhitePeerTest.cs プロジェクト: tmandersson/FastGTD
 public void SetUp()
 {
     commandSerializer = new CustomCommandSerializer();
 }
コード例 #3
0
 public void SetUp()
 {
     commandSerializer = new CustomCommandSerializer();
     var testAutomationPeer = new TestAutomationPeer();
     whitePeer = WhitePeer.CreateForValueProvider(testAutomationPeer, null, () => value, s => value = s);
 }
コード例 #4
0
ファイル: UIItem.cs プロジェクト: tmandersson/FastGTD
 private CustomCommandResponse Execute(ValuePattern valuePattern, string assemblyFile, string typeName, MethodInfo method, object[] arguments)
 {
     var commandSerializer = new CustomCommandSerializer();
     string serializedCommand = commandSerializer.Serialize(new FileInfo(assemblyFile).Name, typeName, method.Name, arguments);
     valuePattern.SetValue(serializedCommand);
     ActionPerformed(Action.WindowMessage);
     string value = valuePattern.Current.Value;
     return new CustomCommandResponse(commandSerializer.ToObject(value));
 }
コード例 #5
0
ファイル: UIItem.cs プロジェクト: tmandersson/FastGTD
        internal virtual CustomCommandResponse Do(string assemblyFile, string typeName, MethodInfo method, object[] arguments)
        {
            var valuePattern = Pattern(ValuePattern.Pattern) as ValuePattern;
            if (valuePattern == null) throw new CustomCommandException(string.Format("{0} does not implement ValuePattern", automationElement.Display()));
            CustomCommandResponse response = Execute(valuePattern, assemblyFile, typeName, method, arguments);
            if (response.IsValidResponse) return response;

            var commandSerializer = new CustomCommandSerializer();
            string serializedAssemblyRequest = commandSerializer.SerializeAssembly(assemblyFile);
            valuePattern.SetValue(serializedAssemblyRequest);

            response = Execute(valuePattern, assemblyFile, typeName, method, arguments);
            valuePattern.SetValue(commandSerializer.SerializeEndSession());
            return response;
        }