예제 #1
0
        static Processor()
        {
            commands = new Dictionary <string, ICommand>();

            commands["set"] = new SetValueCommand();
            commands["get"] = new GetValueCommand();

            commands["sadd"]      = new SetAddMemberCommand();
            commands["srem"]      = new SetRemoveMemberCommand();
            commands["sismember"] = new SetIsMemberCommand();
        }
예제 #2
0
        private bool TryGetValueFromAutomationIdentifier(AutomationIdentifier controlIdentifier, out string value, int ordinal, AutomationIdentifier parentIdentifier)
        {
            value = null;
            var command = new GetValueCommand
            {
                AutomationIdentifier = controlIdentifier,
                Ordinal          = ordinal,
                ParentIdentifier = parentIdentifier
            };

            var result        = SyncExecuteCommand(command);
            var successResult = result as SuccessResult;

            if (successResult == null)
            {
                return(false);
            }

            value = successResult.ResultText;
            return(true);
        }
예제 #3
0
 public ValuesController(GetValueCommand getValueCommand,
                         GetValuesCommand getValuesCommand)
 {
     _getValueCommand  = getValueCommand;
     _getValuesCommand = getValuesCommand;
 }
        private bool TryGetValueFromAutomationIdentifier(AutomationIdentifier controlIdentifier, out string value,
                                                         int ordinal, AutomationIdentifier parentIdentifier)
        {
            value = null;
            var command = new GetValueCommand
                {
                    AutomationIdentifier = controlIdentifier,
                    Ordinal = ordinal,
                    ParentIdentifier = parentIdentifier
                };

            var result = SyncExecuteCommand(command);
            var successResult = result as SuccessResult;
            if (successResult == null)
            {
                return false;
            }

            value = successResult.ResultText;
            return true;
        }
        private bool TryGetValueFromAutomationIdentifier(AutomationIdentifier automationIdentifier, out string textValue)
        {
            textValue = null;
            var command = new GetValueCommand()
            {
                AutomationIdentifier = automationIdentifier
            };
            var result = SyncExecuteCommand(command);
            var successResult = result as SuccessResult;
            if (successResult == null)
                return false;

            textValue = successResult.ResultText;
            return true;
        }