zoukankan      html  css  js  c++  java
  • 关于连接 providers 的一些代码 (学习QD)

    using System;

    using System.Collections.Generic;

    using System.Text;

    using SmartQuant.Providers;

    using System.ComponentModel;

    namespace DummyProvider

    {

        public class MyProvider : IProvider, IMarketDataProvider, IExecutionProvider

        {

            #region IProvider Members

            public void Connect(int timeout)

            {

                this.Connect();

                ProviderManager.WaitConnected(this, timeout);

            }

     

            public void Connect()

            {

                isConnected = true;

                if (Connected != null)

                    Connected(this, new EventArgs());

            }

            public event EventHandler Connected;

     

            public void Disconnect()

            {

                isConnected = false;

                if (Disconnected != null)

                    Disconnected(this, new EventArgs());

            }

     

            public event EventHandler Disconnected;

            public event ProviderErrorEventHandler Error;

     

            public byte Id

            {

                get { return 80; }

            }

     

            private bool isConnected = false;

     

            [Category("Information")]

            public bool IsConnected

            {

                get { return isConnected; }

            }

            [Category("Information")]

            public string Name

            {

                get { return "DummyProvider"; }

            }

     

            [Category("Information")]

            public ProviderStatus Status

            {

                get

                {

                    if (!IsConnected)

                        return ProviderStatus.Disconnected;

                    else

                        return ProviderStatus.Connected;

                }

            }

     

            public event EventHandler StatusChanged;

     

            public string Title

            {

                get { return "This is a dummy provider."; }

            }

     

            public string URL

            {

                get { return String.Empty; }

            }

            #endregion

     

            #region IMarketDataProvider Members

            #region IExecutionProvider Members

        }

    }

  • 相关阅读:
    Java中splite的用法与小技巧
    android asmack调用MultiUserChat.getHostedRooms方法出现空指针的异常解决方案
    android java.lang.ExceptionInInitializerError
    二维码生成与返回客户端
    微信查询所有关注该公众号的用户
    连接数据库报错:句柄无效
    httpclient POST请求(urlencoded)
    小程序——获得用户敏感信息
    作用域浅析
    小程序开发——统一请求方法
  • 原文地址:https://www.cnblogs.com/shalang/p/1521540.html
Copyright © 2011-2022 走看看