Пример #1
0
        public bool EntityIsAvailable(string name, SupportEntityType searchType)
        {
            switch (searchType)
            {
            case SupportEntityType.Method:
            {
                if (null == _listSupportedEntities)
                {
                    _listSupportedEntities = Factory.GetSupportedEntities(_underlyingObject);
                }

                string outValue = null;
                return(_listSupportedEntities.TryGetValue("Method-" + name, out outValue));
            }

            case SupportEntityType.Property:
            {
                if (null == _listSupportedEntities)
                {
                    _listSupportedEntities = Factory.GetSupportedEntities(_underlyingObject);
                }

                string outValue = null;
                return(_listSupportedEntities.TryGetValue("Property-" + name, out outValue));
            }

            default:
            {
                if (null == _listSupportedEntities)
                {
                    _listSupportedEntities = Factory.GetSupportedEntities(_underlyingObject);
                }

                string outValue = null;
                bool   result   = _listSupportedEntities.TryGetValue("Property-" + name, out outValue);
                if (result)
                {
                    return(true);
                }

                return(_listSupportedEntities.TryGetValue("Method-" + name, out outValue));
            }
            }
        }
Пример #2
0
        public bool EntityIsAvailable(string name, SupportEntityType searchType)
        {
            switch (searchType)
            {
                case SupportEntityType.Method:
                {
                    if (null == _listSupportedEntities)
                        _listSupportedEntities = Factory.GetSupportedEntities(_underlyingObject);

                    string outValue = null;
                    return _listSupportedEntities.TryGetValue("Method-" + name, out outValue);   
                }
                case SupportEntityType.Property:
                {
                    if (null == _listSupportedEntities)
                        _listSupportedEntities = Factory.GetSupportedEntities(_underlyingObject);

                    string outValue = null;
                    return _listSupportedEntities.TryGetValue("Property-" + name, out outValue);       
                }
                default:
                {
                    if (null == _listSupportedEntities)
                        _listSupportedEntities = Factory.GetSupportedEntities(_underlyingObject);

                    string outValue = null;
                    bool result = _listSupportedEntities.TryGetValue("Property-" + name, out outValue);
                    if (result)
                        return true;

                    return _listSupportedEntities.TryGetValue("Method-" + name, out outValue);    
                }
            }
        }