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

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

static private GrowPropertiesArray ( IDynamicProperty props ) : IDynamicProperty[]
props IDynamicProperty
Результат IDynamicProperty[]
        internal static IDynamicProperty[] GrowPropertiesArray(IDynamicProperty[] props)
        {
            // grow the array of IContextProperty objects
            int newSize = (props != null ? props.Length : 0)  + GROW_BY;
            IDynamicProperty[] newProps = new IDynamicProperty[newSize];
            if (props != null)
            {
                // Copy existing properties over.
                Array.Copy(props, newProps, props.Length);
            }
            return newProps;
        }

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::GrowPropertiesArray