コード例 #1
0
ファイル: NetBase.cs プロジェクト: Hengle/LitEngine
            virtual public void ClearAppDelgate(string _appname)
            {
                if (mReCallDelgate != null && mReCallDelgate.Method.DeclaringType.IsSubclassOf(typeof(ILRuntime.Runtime.Intepreter.DelegateAdapter)))
                {
                    ILRuntime.Runtime.Intepreter.DelegateAdapter ttypeinstance = (ILRuntime.Runtime.Intepreter.DelegateAdapter)mReCallDelgate.Target;
                    if (ttypeinstance != null && ttypeinstance.AppName.Equals(_appname))
                    {
                        mReCallDelgate = null;
                    }
                }

                if (mMsgHandlerList.Count > 0)
                {
                    List <int> tkeys = new List <int>(mMsgHandlerList.Keys);
                    for (int i = tkeys.Count - 1; i >= 0; i--)
                    {
                        SafeList <System.Action <ReceiveData> > tlist = mMsgHandlerList[tkeys[i]];
                        for (int j = tlist.Count - 1; j >= 0; j--)
                        {
                            System.Action <ReceiveData> tact = tlist[j];

                            if (tact.Method.DeclaringType.IsSubclassOf(typeof(ILRuntime.Runtime.Intepreter.DelegateAdapter)))
                            {
                                ILRuntime.Runtime.Intepreter.DelegateAdapter ttypeinstance = (ILRuntime.Runtime.Intepreter.DelegateAdapter)tact.Target;
                                if (ttypeinstance != null && ttypeinstance.AppName.Equals(_appname))
                                {
                                    tlist.RemoveAt(j);
                                }
                            }
                        }
                        if (tlist.Count == 0)
                        {
                            mMsgHandlerList.Remove(tkeys[i]);
                        }
                    }
                }
            }
コード例 #2
0
 override protected void DisposeGC()
 {
     sUnZipMap.Remove(mKey);
     if (mUnZipObject != null)
     {
         mUnZipObject.Dispose();
     }
     if (mUpdateObject != null)
     {
         mUpdateObject.UnRegToOwner();
     }
     mUpdateObject = null;
     mFinished     = null;
     mProgress     = null;
 }
コード例 #3
0
 override protected void DisposeGC()
 {
     sDownLoadMap.Remove(mURL);
     if (mObject != null)
     {
         mObject.Dispose();
     }
     if (mUpdateObject != null)
     {
         mUpdateObject.UnRegToOwner();
     }
     mUpdateObject = null;
     mFinished     = null;
     mProgress     = null;
 }
コード例 #4
0
ファイル: NetBase.cs プロジェクト: cczxntken/AssetBundleTool
        virtual public void _UnReg(int msgid, System.Action <object> func)
        {
            if (!mMsgHandlerList.ContainsKey(msgid))
            {
                return;
            }
            SafeList <System.Action <object> > tlist = mMsgHandlerList[msgid];

            if (tlist.Contains(func))
            {
                tlist.Remove(func);
            }
            if (tlist.Count == 0)
            {
                mMsgHandlerList.Remove(msgid);
            }
        }