public void Acquire() { TwRC rc; CloseSrc(); if (appid.Id == IntPtr.Zero) { Init(hwnd); if (appid.Id == IntPtr.Zero) { throw new InvalidOperationException("Init call falied"); } } rc = DSMident(appid, IntPtr.Zero, TwDG.Control, TwDAT.Identity, TwMSG.OpenDS, srcds); if (rc != TwRC.Success) { throw new InvalidOperationException("DSMident call falied"); } TwUserInterface guif = new TwUserInterface(); guif.ShowUI = 1; guif.ModalUI = 1; guif.ParentHand = hwnd; rc = DSuserif(appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.EnableDS, guif); if (rc != TwRC.Success) { CloseSrc(); throw new InvalidOperationException("DSuserif call falied"); } }
public void CloseSrc() { TwRC rc; if (srcds.Id != IntPtr.Zero) { TwUserInterface guif = new TwUserInterface(); rc = DSuserif(appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.DisableDS, guif); rc = DSMident(appid, IntPtr.Zero, TwDG.Control, TwDAT.Identity, TwMSG.CloseDS, srcds); } }
public void Acquire() { TwRC rc; CloseSrc(); if( appid.Id == IntPtr.Zero ) { Init( hwnd ); if( appid.Id == IntPtr.Zero ) throw new InvalidOperationException("Init call falied"); } rc = DSMident( appid, IntPtr.Zero, TwDG.Control, TwDAT.Identity, TwMSG.OpenDS, srcds ); if( rc != TwRC.Success ) throw new InvalidOperationException("DSMident call falied"); TwUserInterface guif = new TwUserInterface(); guif.ShowUI = 1; guif.ModalUI = 1; guif.ParentHand = hwnd; rc = DSuserif( appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.EnableDS, guif ); if( rc != TwRC.Success ) { CloseSrc(); throw new InvalidOperationException("DSuserif call falied"); } }
private static extern TwRC DSuserif( [In, Out] TwIdentity origin, [In, Out] TwIdentity dest, TwDG dg, TwDAT dat, TwMSG msg, TwUserInterface guif );
public void CloseSrc() { TwRC rc; if( srcds.Id != IntPtr.Zero ) { TwUserInterface guif = new TwUserInterface(); rc = DSuserif( appid, srcds, TwDG.Control, TwDAT.UserInterface, TwMSG.DisableDS, guif ); rc = DSMident( appid, IntPtr.Zero, TwDG.Control, TwDAT.Identity, TwMSG.CloseDS, srcds ); } }
private static extern TwRC DSuserif([In, Out] TwIdentity origin, [In, Out] TwIdentity dest, TwDG dg, TwDAT dat, TwMSG msg, TwUserInterface guif);