public void Initialize_CallingInitializeBeforeSettingCompleteHandler_ThrowsException()
        {
            Assert.ThrowsException <OpenFinInitializationException>(() =>
            {
                if (DesktopAgent.InitializationComplete != null)
                {
                    DesktopAgent.InitializationComplete = null;
                }

                DesktopAgent.Initialize();
            });
        }
示例#2
0
        private void init()
        {
            if (DesktopAgent.InitializationComplete == null)
            {
                var tcs = new TaskCompletionSource <object>();

                DesktopAgent.InitializationComplete += ex =>
                {
                    tcs.SetResult(null);
                };

                DesktopAgent.Initialize();

                tcs.Task.Wait();
            }
        }