Example #1
0
 public virtual void EnumElements(EnumElementHandler Handler,
                                  ElementType Type,
                                  EnumFlag Flag,
                                  string NameOfElement,
                                  object Param)
 {
 }
Example #2
0
        public void EnumElements(EnumElementHandler Handler,
                                 ElementType Type,
                                 EnumFlag Flag,
                                 string NameOfElement,
                                 object Param)
        {
            Debug.Assert(null != m_iHostService);

            m_iHostService.EnumElements(Handler, Type, Flag, NameOfElement, Param);
        }
Example #3
0
        public void EnumElement(EnumElementHandler Handler,
                                ElementType Type,
                                EnumFlag Flag,
                                string NameOfElement,
                                object Param)
        {
            Debug.Assert(null != Handler);

            //name
            Regex reg = null;

            if (!string.IsNullOrEmpty(NameOfElement))
            {
                reg = new Regex(NameOfElement, RegexOptions.IgnoreCase);
            }

            bool continueEnum = true;

            foreach (var ele in m_dicScreenElements)
            {
                if ((ElementType.Button == Type) &&
                    !(ele.Value is HtmlScreenButtonElement))
                {
                    continue;
                }

                if ((ElementType.Input == Type) &&
                    !(ele.Value is HtmlScreenInputElement))
                {
                    continue;
                }

                if (EnumFlag.OnlyEnable == Flag &&
                    !(ele.Value.IsEnable))
                {
                    continue;
                }

                if (EnumFlag.OnlyVisible == Flag &&
                    !(ele.Value.IsVisible))
                {
                    continue;
                }

                if (EnumFlag.VisibleAndEnable == Flag &&
                    !(ele.Value.IsVisible && ele.Value.IsEnable))
                {
                    continue;
                }

                if (EnumFlag.VisibleOrEnable == Flag &&
                    (!ele.Value.IsEnable && !ele.Value.IsVisible))
                {
                    continue;
                }

                if (null != reg)
                {
                    Match m = reg.Match(ele.Value.HostedElement.Id);
                    if (!m.Success)
                    {
                        continue;
                    }
                }

                continueEnum = Handler.Invoke(ele.Value.HostedElement.Id, ele.Value.Key, Param);
                if (!continueEnum)
                {
                    break;
                }
            }
        }