Exemplo n.º 1
0
        private static void ActionThread(object aArgs)
        {
            ThreadArgs args = (ThreadArgs)aArgs;

            using (CpProxyOpenhomeOrgTestBasic1 proxy = new CpProxyOpenhomeOrgTestBasic1(args.Device))
            {
                uint val;
                do
                {
                    proxy.SyncGetUint(out val);
                } while (args.IncrementCount());
            }
        }
Exemplo n.º 2
0
        private static void SubscriptionThread(object aArgs)
        {
            ThreadArgs args = (ThreadArgs)aArgs;
            Semaphore  sem  = new Semaphore(0, 1);

            do
            {
                CpProxyOpenhomeOrgTestBasic1 proxy = new CpProxyOpenhomeOrgTestBasic1(args.Device);
                proxy.SetPropertyChanged(() => sem.Release());
                proxy.Subscribe();
                sem.WaitOne();
                proxy.Dispose();
            } while (args.IncrementCount());
        }