コード例 #1
0
 internal bool AddServerSideDynamicProperty(IDynamicProperty prop)
 {
     if (this._dphSrv == null)
     {
         DynamicPropertyHolder holder = new DynamicPropertyHolder();
         bool lockTaken = false;
         RuntimeHelpers.PrepareConstrainedRegions();
         try
         {
             Monitor.Enter(this, ref lockTaken);
             if (this._dphSrv == null)
             {
                 this._dphSrv = holder;
             }
         }
         finally
         {
             if (lockTaken)
             {
                 Monitor.Exit(this);
             }
         }
     }
     return this._dphSrv.AddDynamicProperty(prop);
 }
コード例 #2
0
 private bool AddPerContextDynamicProperty(IDynamicProperty prop)
 {
     if (_dphCtx == null)
     {
         DynamicPropertyHolder dph = new DynamicPropertyHolder();
         lock (this)
         {
             if (_dphCtx == null)
             {
                 _dphCtx = dph;
             }
         }
     }
     return(_dphCtx.AddDynamicProperty(prop));
 }
コード例 #3
0
 private bool AddPerContextDynamicProperty(IDynamicProperty prop)
 {
     if (this._dphCtx == null)
     {
         DynamicPropertyHolder holder = new DynamicPropertyHolder();
         lock (this)
         {
             if (this._dphCtx == null)
             {
                 this._dphCtx = holder;
             }
         }
     }
     return(this._dphCtx.AddDynamicProperty(prop));
 }
コード例 #4
0
 internal bool AddProxySideDynamicProperty(IDynamicProperty prop)
 {
     lock (this)
     {
         if (this._dph == null)
         {
             DynamicPropertyHolder holder = new DynamicPropertyHolder();
             lock (this)
             {
                 if (this._dph == null)
                 {
                     this._dph = holder;
                 }
             }
         }
         return this._dph.AddDynamicProperty(prop);
     }
 }
コード例 #5
0
        internal virtual bool NotifyDynamicSinks(
            IMessage msg,
            bool bCliSide,
            bool bStart,
            bool bAsync,
            bool bNotifyGlobals)
        {
            bool bHasDynamicSinks = false;

            if (bNotifyGlobals && (_dphGlobal.DynamicProperties != null))
            {
                ArrayWithSize globalSinks = GlobalDynamicSinks;
                if (globalSinks != null)
                {
                    DynamicPropertyHolder.NotifyDynamicSinks(
                        msg,
                        globalSinks,
                        bCliSide,
                        bStart,
                        bAsync);
                    bHasDynamicSinks = true;
                }
            }

            ArrayWithSize perCtxSinks = DynamicSinks;

            if (perCtxSinks != null)
            {
                DynamicPropertyHolder.NotifyDynamicSinks(
                    msg,
                    perCtxSinks,
                    bCliSide,
                    bStart,
                    bAsync);
                bHasDynamicSinks = true;
            }

            return(bHasDynamicSinks);
        } // NotifyDynamicSinks
コード例 #6
0
ファイル: context.cs プロジェクト: wwkkww1983/ZJCredit
        internal virtual bool NotifyDynamicSinks(IMessage msg, bool bCliSide, bool bStart, bool bAsync, bool bNotifyGlobals)
        {
            bool flag = false;

            if (bNotifyGlobals && Context._dphGlobal.DynamicProperties != null)
            {
                ArrayWithSize globalDynamicSinks = Context.GlobalDynamicSinks;
                if (globalDynamicSinks != null)
                {
                    DynamicPropertyHolder.NotifyDynamicSinks(msg, globalDynamicSinks, bCliSide, bStart, bAsync);
                    flag = true;
                }
            }
            ArrayWithSize dynamicSinks = this.DynamicSinks;

            if (dynamicSinks != null)
            {
                DynamicPropertyHolder.NotifyDynamicSinks(msg, dynamicSinks, bCliSide, bStart, bAsync);
                flag = true;
            }
            return(flag);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
 internal virtual bool AddDynamicProperty(IDynamicProperty prop)
 {
     lock (this)
     {
         DynamicPropertyHolder.CheckPropertyNameClash(prop.Name, this._props, this._numProps);
         bool local_2 = false;
         if (this._props == null || this._numProps == this._props.Length)
         {
             this._props = DynamicPropertyHolder.GrowPropertiesArray(this._props);
             local_2     = true;
         }
         IDynamicProperty[] temp_19 = this._props;
         int local_3 = this._numProps;
         this._numProps = local_3 + 1;
         int temp_26 = local_3;
         IDynamicProperty temp_27 = prop;
         temp_19[temp_26] = temp_27;
         if (local_2)
         {
             this._sinks = DynamicPropertyHolder.GrowDynamicSinksArray(this._sinks);
         }
         if (this._sinks == null)
         {
             this._sinks = new IDynamicMessageSink[this._props.Length];
             for (int local_4 = 0; local_4 < this._numProps; ++local_4)
             {
                 this._sinks[local_4] = ((IContributeDynamicSink)this._props[local_4]).GetDynamicSink();
             }
         }
         else
         {
             this._sinks[this._numProps - 1] = ((IContributeDynamicSink)prop).GetDynamicSink();
         }
         return(true);
     }
 }
コード例 #9
0
ファイル: ServerIdentity.cs プロジェクト: sjyanxin/WPFSource
 [System.Security.SecurityCritical]  // auto-generated
 internal bool AddServerSideDynamicProperty(
     IDynamicProperty prop) 
 {
     if (_dphSrv == null) 
     { 
         DynamicPropertyHolder dphSrv = new DynamicPropertyHolder();
         bool fLocked = false; 
         RuntimeHelpers.PrepareConstrainedRegions();
         try
         {
             Monitor.Enter(this, ref fLocked); 
             if (_dphSrv == null)
             { 
                 _dphSrv = dphSrv; 
             }
         } 
         finally
         {
             if (fLocked)
             { 
                 Monitor.Exit(this);
             } 
         } 
     }
     return _dphSrv.AddDynamicProperty(prop); 
 }
コード例 #10
0
 [System.Security.SecurityCritical]  // auto-generated
 private bool AddPerContextDynamicProperty(IDynamicProperty prop)
 {
     if (_dphCtx == null)
     {
         DynamicPropertyHolder dph = new DynamicPropertyHolder();
         lock (this)
         {
             if (_dphCtx == null)
             {
                 _dphCtx = dph;
             }
         }
     }
     return _dphCtx.AddDynamicProperty(prop);
 }
コード例 #11
0
 [System.Security.SecurityCritical]  // auto-generated
 internal bool AddProxySideDynamicProperty(IDynamicProperty prop)
 {
     lock(this)
     {
         if (_dph == null)
         {
             DynamicPropertyHolder dph = new DynamicPropertyHolder();
             lock(this)
             {
                 if (_dph == null)
                 {
                     _dph = dph;
                 }
             }
         }
         return _dph.AddDynamicProperty(prop);
     }
 }
コード例 #12
0
ファイル: serveridentity.cs プロジェクト: ArildF/masters
 /*package*/
 internal bool AddServerSideDynamicProperty(
     IDynamicProperty prop)
 {
     if (_dphSrv == null)
     {
         DynamicPropertyHolder dphSrv = new DynamicPropertyHolder();
         lock (this)
         {
             if (_dphSrv == null)
             {
                 _dphSrv = dphSrv;
             }
         }
     }
     return _dphSrv.AddDynamicProperty(prop);
 }
コード例 #13
0
 private bool AddPerContextDynamicProperty(IDynamicProperty prop)
 {
     if (this._dphCtx == null)
     {
         DynamicPropertyHolder holder = new DynamicPropertyHolder();
         lock (this)
         {
             if (this._dphCtx == null)
             {
                 this._dphCtx = holder;
             }
         }
     }
     return this._dphCtx.AddDynamicProperty(prop);
 }