Пример #1
0
 public static IScriptCommand FindLogicalParent(string elementVariable       = "{Sender}",
                                                FindMethodType method        = FindMethodType.Name,
                                                string findParameterVariable = "{Parameter}",
                                                string destinationVariable   = "{Destination}",
                                                IScriptCommand nextCommand   = null)
 {
     return(FindUIElement(elementVariable, FindDirectionType.Parent, FindTreeType.Logical, method, findParameterVariable, destinationVariable, nextCommand));
 }
Пример #2
0
        public static IScriptCommand IfExistsVisualParent(string elementVariable       = "{Sender}",
                                                          FindMethodType method        = FindMethodType.Name,
                                                          string findparameterVariable = "{Parameter}",
                                                          IScriptCommand trueCommand   = null, IScriptCommand otherwiseCommand = null)
        {
            string destinationVariable = ParameterDic.CombineVariable(elementVariable, "Destination");

            return(FindVisualParent(elementVariable, method, findparameterVariable, destinationVariable,
                                    ScriptCommands.IfAssigned(destinationVariable, trueCommand, otherwiseCommand)));
        }
Пример #3
0
 public static IScriptCommand FindUIElement(
     string elementVariable       = "{Sender}",
     FindDirectionType direction  = FindDirectionType.Parent,
     FindTreeType tree            = FindTreeType.Visual,
     FindMethodType method        = FindMethodType.Name,
     string findParameterVariable = "{Parameter}",
     string destinationVariable   = "{Destination}",
     IScriptCommand nextCommand   = null)
 {
     return(new FindUIElement()
     {
         SenderKey = elementVariable,
         FindDirection = direction,
         FindTree = tree,
         FindMethod = method,
         FindParameterKey = findParameterVariable,
         DestinationKey = destinationVariable,
         NextCommand = (ScriptCommandBase)nextCommand
     });
 }