public object this[string id]
        {
            get
            {
                IMixable mixable = null;

                if (_current.HasKey(id))
                {
                    object value = _current[id];

                    if (value is IMixable)
                    {
                        mixable = value as IMixable;

                        if (!mixable.IsMixMeaningful)
                        {
                            return(mixable);
                        }
                    }
                    else if (value != null)
                    {
                        return(value);
                    }
                }

                if (_style != null)
                {
                    for (int idx = 0; idx < _style.Length; ++idx)
                    {
                        if (_style[idx] != null)
                        {
                            object value = _style[idx][id];

                            if (value is IMixable)
                            {
                                if (mixable == null)
                                {
                                    mixable = value as IMixable;
                                }
                                else
                                {
                                    mixable = mixable.Mix(value as IMixable);
                                }

                                if (!mixable.IsMixMeaningful)
                                {
                                    return(mixable);
                                }
                            }
                            else if (value != null)
                            {
                                return(value);
                            }
                        }
                    }
                }

                return(mixable);
            }
        }
Exemple #2
0
        public object this[string id]
        {
            get
            {
                if (_current.HasKey(id))
                {
                    object value = _current[id];

                    if (value != null)
                    {
                        return value;
                    }
                }

                if (_style != null)
                {
                    for (int idx = 0; idx < _style.Length; ++idx)
                    {
                        if ( _style[idx] != null )
                        {
                            object value = _style[idx][id];

                            if (value != null)
                            {
                                return value;
                            }
                        }
                    }
                }

                return null;
            }
        }