Beispiel #1
0
        public void CloseSrc()
        {
            TwReturnCode returnCode;

            if (srcds.Id != IntPtr.Zero)
            {
                var guif = new TwUserInterface();
                returnCode = DSuserif(appid, srcds, TwDG.Control, TwData.UserInterface, TwMessageCode.DisableDS, guif);
                returnCode = DSMident(appid, IntPtr.Zero, TwDG.Control, TwData.Identity, TwMessageCode.CloseDS, srcds);
            }
        }
Beispiel #2
0
        public bool Acquire()
        {
            TwReturnCode returnCode;

            CloseSrc();
            if (appid.Id == IntPtr.Zero)
            {
                Init(hwnd);
                if (appid.Id == IntPtr.Zero)
                {
                    throw new InvalidOperationException("Init call falied");
                }
            }
            returnCode = DSMident(appid, IntPtr.Zero, TwDG.Control, TwData.Identity, TwMessageCode.OpenDS, srcds);
            if (returnCode != TwReturnCode.Success)
            {
                throw new InvalidOperationException("DSMident call falied");
            }

            var guif = new TwUserInterface
            {
                ShowUI     = 1,
                ModalUI    = 1,
                ParentHand = hwnd
            };

            returnCode = DSuserif(appid, srcds, TwDG.Control, TwData.UserInterface, TwMessageCode.EnableDS, guif);
            if (returnCode != TwReturnCode.Success)
            {
                CloseSrc();
                if (returnCode == TwReturnCode.Cancel)
                {
                    return(false);
                }
                throw new InvalidOperationException("DSuserif call falied");
            }
            return(true);
        }
Beispiel #3
0
 private static extern TwReturnCode DSuserif([In, Out] TwIdentity origin, [In, Out] TwIdentity dest, TwDG dg, TwData data, TwMessageCode messageCode, TwUserInterface guif);
Beispiel #4
0
 private static extern TwReturnCode DSuserif([In, Out] TwIdentity origin, [In, Out] TwIdentity dest, TwDG dg, TwData data, TwMessageCode messageCode, TwUserInterface guif);
Beispiel #5
0
 public void CloseSrc()
 {
     TwReturnCode returnCode;
     if (srcds.Id != IntPtr.Zero)
     {
         var guif = new TwUserInterface();
         returnCode = DSuserif(appid, srcds, TwDG.Control, TwData.UserInterface, TwMessageCode.DisableDS, guif);
         returnCode = DSMident(appid, IntPtr.Zero, TwDG.Control, TwData.Identity, TwMessageCode.CloseDS, srcds);
     }
 }
Beispiel #6
0
        public bool Acquire()
        {
            TwReturnCode returnCode;
            CloseSrc();
            if (appid.Id == IntPtr.Zero)
            {
                Init(hwnd);
                if (appid.Id == IntPtr.Zero)
                    throw new InvalidOperationException("Init call falied");
            }
            returnCode = DSMident(appid, IntPtr.Zero, TwDG.Control, TwData.Identity, TwMessageCode.OpenDS, srcds);
            if (returnCode != TwReturnCode.Success)
                throw new InvalidOperationException("DSMident call falied");

            var guif = new TwUserInterface
            {
                ShowUI = 1,
                ModalUI = 1,
                ParentHand = hwnd
            };
            returnCode = DSuserif(appid, srcds, TwDG.Control, TwData.UserInterface, TwMessageCode.EnableDS, guif);
            if (returnCode != TwReturnCode.Success)
            {
                CloseSrc();
                if (returnCode == TwReturnCode.Cancel)
                {
                    return false;
                }
                throw new InvalidOperationException("DSuserif call falied");
            }
            return true;
        }