Exemplo n.º 1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Initialize the API </summary>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public void Init(tt_setup_sdk.TTSetupSDKOptions apiConfig)
        {
            TTSetupSDKInitializeHandler apiInitializeHandler = new TTSetupSDKInitializeHandler(TTSetupSdkInitHandler);

            TTSetupSDK.ShutdownCompleted += TTSetupSDK_ShutdownCompleted;
            TTSetupSDK.CreateTTSetupSDK(m_disp, apiConfig, apiInitializeHandler);
        }
Exemplo n.º 2
0
        public void Start(tt_setup_sdk.TTSetupSDKOptions apiConfig)
        {
            m_disp = tt_setup_sdk.Dispatcher.AttachWorkerDispatcher();
            m_disp.DispatchAction(() =>
            {
                Init(apiConfig);
            });

            m_disp.Run();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            try
            {
                //Add your app secret Key here . The app_key looks like : 00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000
                string appSecretKey = "";

                //Set the environment the app needs to run in here
                tt_setup_sdk.ServiceEnvironment environment = tt_setup_sdk.ServiceEnvironment.DevCert;

                tt_setup_sdk.TTSetupSDKOptions apiConfig = new tt_setup_sdk.TTSetupSDKOptions(
                    environment,
                    appSecretKey);

                // Start the TT SETUP SDK on the same thread
                TTSetUpFunctions tf = new TTSetUpFunctions();

                Thread workerThread = new Thread(() => tf.Start(apiConfig));
                workerThread.Name = "TT SETUP SDK Thread";
                workerThread.Start();

                while (true)
                {
                    string input = System.Console.ReadLine();

                    if (input == "a")
                    {
                        tf.GetAllAccounts();
                    }

                    if (input == "q")
                    {
                        break;
                    }
                }
                tf.Dispose();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + "\n" + e.StackTrace);
            }
        }