System.Runtime.Remoting.Contexts.DynamicPropertyHolder.CheckPropertyNameClash C# (CSharp) Метод

CheckPropertyNameClash() статический приватный Метод

static private CheckPropertyNameClash ( String name, IDynamicProperty props, int count ) : void
name String
props IDynamicProperty
count int
Результат void
        internal static void CheckPropertyNameClash(String name, IDynamicProperty[] props, int count)
        {
            for (int i=0; i<count; i++)
            {
                if (props[i].Name.Equals(name))
                {
                    throw new InvalidOperationException(
                        Environment.GetResourceString(
                            "InvalidOperation_DuplicatePropertyName"));
                }
            }        
        }

Usage Example

        internal virtual bool AddDynamicProperty(IDynamicProperty prop)
        {
            bool result;

            lock (this)
            {
                DynamicPropertyHolder.CheckPropertyNameClash(prop.Name, this._props, this._numProps);
                bool flag2 = false;
                if (this._props == null || this._numProps == this._props.Length)
                {
                    this._props = DynamicPropertyHolder.GrowPropertiesArray(this._props);
                    flag2       = true;
                }
                IDynamicProperty[] props = this._props;
                int numProps             = this._numProps;
                this._numProps  = numProps + 1;
                props[numProps] = prop;
                if (flag2)
                {
                    this._sinks = DynamicPropertyHolder.GrowDynamicSinksArray(this._sinks);
                }
                if (this._sinks == null)
                {
                    this._sinks = new IDynamicMessageSink[this._props.Length];
                    for (int i = 0; i < this._numProps; i++)
                    {
                        this._sinks[i] = ((IContributeDynamicSink)this._props[i]).GetDynamicSink();
                    }
                }
                else
                {
                    this._sinks[this._numProps - 1] = ((IContributeDynamicSink)prop).GetDynamicSink();
                }
                result = true;
            }
            return(result);
        }
All Usage Examples Of System.Runtime.Remoting.Contexts.DynamicPropertyHolder::CheckPropertyNameClash