コード例 #1
0
ファイル: Example1.xaml.cs プロジェクト: jbohac/TwoDeviceDemo
        public MainPage()
        {
            this.InitializeComponent();

            builder = new ServiceBusConnectionStringBuilder(this.ConnectionString);
            builder.TransportType = TransportType.Amqp;

            factory = MessagingFactory.CreateFromConnectionString(this.ConnectionString);

            topicClient = factory.CreateTopicClient("topic2");
            subClient = factory.CreateSubscriptionClient("topic2", "sub1", ReceiveMode.PeekLock);
        }
コード例 #2
0
        public Example2View()
        {
            this.InitializeComponent();

            builder = new ServiceBusConnectionStringBuilder(this.ConnectionString);
            builder.TransportType = TransportType.Amqp;
            factory = MessagingFactory.CreateFromConnectionString(this.ConnectionString);
            topicClient = factory.CreateTopicClient("topic3");
            subClient = factory.CreateSubscriptionClient("topic3", "sub1", ReceiveMode.PeekLock);


            Task.Run(async () =>
            {
                await RunAsync();
            });
        }
コード例 #3
0
        public MainPage()
        {
            this.InitializeComponent();

            //Amqp.Trace.TraceLevel = Amqp.TraceLevel.Frame | Amqp.TraceLevel.Verbose;
            //Amqp.Trace.TraceListener = (f, a) => Debug.WriteLine(DateTime.Now.ToString("[hh:ss.fff]") + " " + Fx.Format(f, a));

            builder = new ServiceBusConnectionStringBuilder(this.ConnectionString);
            builder.TransportType = TransportType.Amqp;
            factory = MessagingFactory.CreateFromConnectionString(this.ConnectionString);
            topicClient = factory.CreateTopicClient("topic1");
            subClient = factory.CreateSubscriptionClient("topic1", "BankerChannel", ReceiveMode.PeekLock);

            factory.Close();

            Task.Run(async () =>
            {
                await RunAsync();
            });
        }