当前位置: 首页>>代码示例>>C#>>正文


C# Connector.Connect方法代码示例

本文整理汇总了C#中Connector.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# Connector.Connect方法的具体用法?C# Connector.Connect怎么用?C# Connector.Connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Connector的用法示例。


在下文中一共展示了Connector.Connect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    static void Main(string[] args)
    {
        NetConfig.LatencySimulation = true;
        Connector client = new Connector("Sample1.1", false);

        Clock fastClock = new Clock(0.02f);
        Clock slowClock = new Clock(1.0f);
        fastClock.OnFixedUpdate += SendPayload;
        slowClock.OnFixedUpdate += SendNotification;

        Program.peer = client.Connect("127.0.0.1:42324");

        while (true)
        {
          fastClock.Tick();
          slowClock.Tick();
          client.Update();

          if (Console.KeyAvailable)
          {
        ConsoleKeyInfo key = Console.ReadKey(true);
        switch (key.Key)
        {
          case ConsoleKey.F1:
            client.Stop();
            return;

          default:
            break;
        }
          }
        }
    }
开发者ID:ashoulson,项目名称:MiniUDP,代码行数:33,代码来源:Program.cs

示例2: Form2

        public Form2()
        {
            connector = new Connector();

            connector.DeviceConnected += new EventHandler(OnDeviceConnected);
            connector.Connect("COM31");
            InitializeComponent();
        }
开发者ID:andrehendriks,项目名称:WindowsFormApplication1,代码行数:8,代码来源:Form2.cs

示例3: connect

 public connect(game game) 
 {
     connector = new Connector();
     connector.ConnectedEvent += new ConnectedHandler(connector_ConnectedEvent);
     connector.Connect("127.0.0.1",59398);
     gamee = game;
     return;
 }
开发者ID:gamificationvn,项目名称:chinese-chess-c-sharp,代码行数:8,代码来源:connect.cs

示例4: button_connect_Click

 private void button_connect_Click(object sender, RoutedEventArgs e)
 {
     Connector connector = new Connector();
     connector.DeviceConnected += new EventHandler(OnDeviceConnected);
     connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
     connector.DeviceValidating += new EventHandler(OnDeviceValidating);
     connector.DeviceDisconnected += new EventHandler(OnDeviceDisconnected);
     connector.Connect("COM31");
     Thread.Sleep(450000);
 }
开发者ID:andrehendriks,项目名称:MyThinkGear1,代码行数:10,代码来源:MainWindow.xaml.cs

示例5: Main

        public void Main()
        {
            Connector connector = new Connector();
            connector.DeviceConnected += new EventHandler(OnDeviceConnected);
            connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
            connector.DeviceValidating += new EventHandler(OnDeviceValidating);
            connector.Connect("COM31");

            progressBar.ValueChanged += ProgressBar_ValueChanged;

            Thread.Sleep(450000);
        }
开发者ID:andrehendriks,项目名称:MyThinkGear1,代码行数:12,代码来源:MainWindow.xaml.cs

示例6: Connect

 public bool Connect()
 {
     try
     {
         mConnector = new Connector();
         mConnector.OnClientConnected += mConnector_OnClientConnected;
         mConnector.Connect(mCenterServer.ip, mCenterServer.port);
         return true;
     }
     catch (Exception)
     {
         //Console.WriteLine(e.ToString());
         return false;
     }
 }
开发者ID:shoftee,项目名称:DwaSeong,代码行数:15,代码来源:CenterServerConnection.cs

示例7: PrepareHeadset

        void PrepareHeadset(string v_port, TextBox v_text, ProgressBar v_progress)
        {
            Connector v_connector = new Connector();
            v_connector.setBlinkDetectionEnabled(true);
            v_connector.DeviceConnected += delegate(object sender2, EventArgs e2)
            {
                OnDeviceConnected(sender2, e2, v_text, v_progress);
            };
            // v_connector.DeviceFound += new EventHandler(OnDeviceFound);
            v_connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
            v_connector.DeviceValidating += new EventHandler(OnDeviceValidating);
            v_connector.Connect(v_port);
            connectors.Add(v_connector);

            //connector2.DeviceConnected += new EventHandler(OnDeviceConnected);
        }
开发者ID:TRaffii,项目名称:Mindwave_Computer_Steering,代码行数:16,代码来源:MainWindow.xaml.cs


注:本文中的Connector.Connect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。