Beispiel #1
0
        /// <summary>
        /// Just provide the ElementInfo Object and would generate supported Action for the same according to the current selected Platform
        /// </summary>
        /// <param name="elementInfo"></param>
        /// <param name="mContext"></param>
        /// <returns></returns>
        static Act GeneratePOMElementRelatedAction(ElementInfo elementInfo, Context mContext)
        {
            Act           instance;
            IPlatformInfo mPlatform  = PlatformInfoBase.GetPlatformImpl(mContext.Platform);
            string        elementVal = string.Empty;

            if (elementInfo.OptionalValuesObjectsList.Count > 0)
            {
                elementVal = Convert.ToString(elementInfo.OptionalValuesObjectsList.Where(v => v.IsDefault).FirstOrDefault().Value);
            }

            ElementActionCongifuration actionConfigurations = new ElementActionCongifuration
            {
                LocateBy           = eLocateBy.POMElement,
                LocateValue        = elementInfo.ParentGuid.ToString() + "_" + elementInfo.Guid.ToString(),
                ElementValue       = elementVal,
                AddPOMToAction     = true,
                POMGuid            = elementInfo.ParentGuid.ToString(),
                ElementGuid        = elementInfo.Guid.ToString(),
                LearnedElementInfo = elementInfo,
            };

            instance = mPlatform.GetPlatformAction(elementInfo, actionConfigurations);
            return(instance);
        }