public void DeleteCppVersionCallBack()
 {
     if (this.mCallBack != IntPtr.Zero)
     {
         IntPtr callBackGCHandle = IIPSMobileVersionCallBack.GetCallBackGCHandle(this.mCallBack);
         GCHandle.FromIntPtr(callBackGCHandle).Free();
         IIPSMobileVersionCallBack.DestroyVersionInfoCallBack(this.mCallBack);
         this.mCallBack = IntPtr.Zero;
     }
 }
Exemplo n.º 2
0
        public bool MgrInitVersionManager(IIPSMobileVersionCallBack callBack, uint bufferSize, byte[] configBuffer)
        {
            if (this.mVersionMgr == IntPtr.Zero)
            {
                return(false);
            }
            GCHandle handle = GCHandle.Alloc(configBuffer, GCHandleType.Pinned);
            IntPtr   ptr    = handle.AddrOfPinnedObject();

            handle.Free();
            return(InitVersionMgr(this.mVersionMgr, callBack.mCallBack, bufferSize, ptr) > 0);
        }
Exemplo n.º 3
0
        public bool MgrInitVersionManager(IIPSMobileVersionCallBack callBack, uint bufferSize, byte[] configBuffer)
        {
            if (this.mVersionMgr == IntPtr.Zero)
            {
                return(false);
            }
            GCHandle gCHandle      = GCHandle.Alloc(configBuffer, 3);
            IntPtr   configBuffer2 = gCHandle.AddrOfPinnedObject();

            gCHandle.Free();
            return(VersionMgr.InitVersionMgr(this.mVersionMgr, callBack.mCallBack, bufferSize, configBuffer2) > 0);
        }
Exemplo n.º 4
0
 public void DeleteVersionMgr()
 {
     if (this.vMgr != null)
     {
         this.vMgr.DeleteCppVersionManager();
         this.vMgr = null;
     }
     if (this.mCallback != null)
     {
         this.mCallback.DeleteCppVersionCallBack();
         this.mCallback = null;
     }
 }
        public bool MgrInitVersionManager(/*System.IntPtr callback*/ IIPSMobileVersionCallBack callBack, System.UInt32 bufferSize, byte[] configBuffer /*System.IntPtr configBuffer*/)
        {
            if (mVersionMgr == System.IntPtr.Zero)
            {
                return(false);
            }


            GCHandle pinnedArray = GCHandle.Alloc(configBuffer, GCHandleType.Pinned);

            System.IntPtr configPointer = pinnedArray.AddrOfPinnedObject();
            pinnedArray.Free();
            return(InitVersionMgr(mVersionMgr, callBack.mCallBack, bufferSize, configPointer) > 0);
        }
Exemplo n.º 6
0
 public IIPSMobileVersionMgrInterface CreateVersionMgr(IIPSMobileVersionCallBackInterface CallbackImp, string config)
 {
     if (this.vMgr == null)
     {
         this.vMgr = new VersionMgr();
         this.vMgr.CreateCppVersionManager();
         this.mCallback = new IIPSMobileVersionCallBack(CallbackImp);
         this.mCallback.CreateCppVersionInfoCallBack();
         if (!this.vMgr.MgrInitVersionManager(this.mCallback, (uint)config.Length, Encoding.ASCII.GetBytes(config)))
         {
             this.mLastErr = this.vMgr.MgrGetVersionMgrLastError();
             return(null);
         }
     }
     return(this.vMgr);
 }
 protected override void Finalize()
 {
     try
     {
         if (this.mCallBack != IntPtr.Zero)
         {
             IntPtr callBackGCHandle = IIPSMobileVersionCallBack.GetCallBackGCHandle(this.mCallBack);
             GCHandle.FromIntPtr(callBackGCHandle).Free();
             IIPSMobileVersionCallBack.DestroyVersionInfoCallBack(this.mCallBack);
             this.mCallBack = IntPtr.Zero;
         }
     }
     finally
     {
         base.Finalize();
     }
 }
        public IIPSMobileVersionMgrInterface CreateVersionMgr(IIPSMobileVersionCallBackInterface CallbackImp, string config)
        {
            if (vMgr != null)
            {
                return(vMgr);
            }
            vMgr = new VersionMgr();
            vMgr.CreateCppVersionManager();
            mCallback = new IIPSMobileVersionCallBack(CallbackImp);
            mCallback.CreateCppVersionInfoCallBack();
            bool ret = vMgr.MgrInitVersionManager(mCallback, (uint)config.Length, System.Text.Encoding.ASCII.GetBytes(config));

            if (!ret)
            {
                mLastErr = vMgr.MgrGetVersionMgrLastError();
                return(null);
            }
            else
            {
                return(vMgr);
            }
        }
 public void CreateCppVersionInfoCallBack()
 {
     this.mCallBack = IIPSMobileVersionCallBack.CreateVersionInfoCallBack(new IIPSMobileVersionCallBack.OnGetNewVersionInfoFunc(IIPSMobileVersionCallBack.OnGetNewVersionInfo), new IIPSMobileVersionCallBack.OnProgressFunc(IIPSMobileVersionCallBack.OnProgress), new IIPSMobileVersionCallBack.OnErrorFunc(IIPSMobileVersionCallBack.OnError), new IIPSMobileVersionCallBack.OnSuccessFunc(IIPSMobileVersionCallBack.OnSuccess), new IIPSMobileVersionCallBack.SaveConfigFunc(IIPSMobileVersionCallBack.SaveConfig), new IIPSMobileVersionCallBack.OnNoticeInstallApkFunc(IIPSMobileVersionCallBack.OnNoticeInstallApk), new IIPSMobileVersionCallBack.OnActionMsgFunc(IIPSMobileVersionCallBack.OnActionMsg), this.pManagedObject);
 }