Пример #1
0
        public override List <ActUIElement.eElementAction> GetPlatformUIElementActionsList(eElementType ElementType)
        {
            List <ActUIElement.eElementAction> list = new List <ActUIElement.eElementAction>();

            switch (ElementType)
            {
            default:
                ElementTypeOperations elementTypeOperations = GetElementTypesWithOperations().Where(x => x.ElementType == ElementType).FirstOrDefault();
                if (elementTypeOperations != null)
                {
                    if (elementTypeOperations.ActionType == typeof(ActUIElement))
                    {
                        elementTypeOperations.ElementOperationsList.ForEach(z => list.Add((ActUIElement.eElementAction)(object) z));
                    }
                }
                break;
            }
            return(list);
        }
Пример #2
0
        public override ObservableList <Act> GetPlatformElementActions(ElementInfo elementInfo)
        {
            ObservableList <Act> UIElementsActionsList = new ObservableList <Act>();

            ElementTypeOperations elementTypeOperations = GetElementTypesWithOperations().Where(x => x.ElementType == elementInfo.ElementTypeEnum).FirstOrDefault();

            if ((elementTypeOperations != null) && ((elementTypeOperations.ElementOperationsList != null)) && (elementTypeOperations.ElementOperationsList.Count > 0))
            {
                if (elementTypeOperations.ActionType == typeof(ActBrowserElement))
                {
                    elementTypeOperations.ElementOperationsList.ForEach(z => UIElementsActionsList.Add
                                                                            (new ActBrowserElement()
                    {
                        Description   = ((EnumValueDescriptionAttribute[])typeof(ActBrowserElement.eControlAction).GetField(z.ToString()).GetCustomAttributes(typeof(EnumValueDescriptionAttribute), false)).ToString() + elementInfo.ElementTitle,
                        ControlAction = (ActBrowserElement.eControlAction)System.Enum.Parse(typeof(ActBrowserElement.eControlAction), z.ToString()),
                        Value         = "true"
                    }));
                }
                else
                {
                    if (elementTypeOperations.ActionType == typeof(ActUIElement))
                    {
                        elementTypeOperations.ElementOperationsList.ForEach(z => UIElementsActionsList.Add
                                                                                (new ActUIElement()
                        {
                            Description   = ((EnumValueDescriptionAttribute[])typeof(ActUIElement.eElementAction).GetField(z.ToString()).GetCustomAttributes(typeof(EnumValueDescriptionAttribute), false))[0].ValueDescription + " : " + elementInfo.ElementTitle,
                            ElementAction = (ActUIElement.eElementAction)z,
                            ElementType   = elementTypeOperations.ElementType,
                            // ElementAction = (ActUIElement.eElementAction)System.Enum.Parse(typeof(ActUIElement.eElementAction), z.ToString()),
                            // Value = "true"   // to check what to do with this
                        }));
                    }
                }
            }
            return(UIElementsActionsList);
        }