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

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

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

Usage Example

Пример #1
0
 public virtual void SetProperty(IContextProperty prop)
 {
     if (prop == null || prop.Name == null)
     {
         throw new ArgumentNullException(prop == null ? "prop" : "property name");
     }
     if ((this._ctxFlags & 2) != 0)
     {
         throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_AddContextFrozen"));
     }
     lock (this)
     {
         Context.CheckPropertyNameClash(prop.Name, this._ctxProps, this._numCtxProps);
         if (this._ctxProps == null || this._numCtxProps == this._ctxProps.Length)
         {
             this._ctxProps = Context.GrowPropertiesArray(this._ctxProps);
         }
         IContextProperty[] temp_28 = this._ctxProps;
         int local_2 = this._numCtxProps;
         this._numCtxProps = local_2 + 1;
         int temp_35 = local_2;
         IContextProperty temp_36 = prop;
         temp_28[temp_35] = temp_36;
     }
 }