Exemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ZyanConnection connection = LoginAndConnect();

            if (connection != null)
            {
                try
                {
                    CalcForm    form  = new CalcForm();
                    ICalculator proxy = connection.CreateProxy <ICalculator>();

                    form.Out_AddNumbers = Asynchronizer <AdditionRequest> .WireUp(proxy.In_AddNumbers);

                    proxy.Out_SendResult = SyncContextSwitcher <decimal> .WireUp(form.In_ReceiveResult);

                    Application.Run(form);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    connection.Dispose();
                }
            }
        }
Exemplo n.º 2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ZyanConnection connection = LoginAndConnect();

            if (connection != null)
            {
                try
                {
                    CalcForm form = new CalcForm();
                    ICalculator proxy = connection.CreateProxy<ICalculator>();

                    form.Out_AddNumbers = Asynchronizer<AdditionRequest>.WireUp(proxy.In_AddNumbers);
                    proxy.Out_SendResult = SyncContextSwitcher<decimal>.WireUp(form.In_ReceiveResult);

                    Application.Run(form);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    connection.Dispose();
                }
            }
        }