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


C# ConnectionState.ToString方法代码示例

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


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

示例1: Handle

 /// <summary>Executes behavior.</summary>
 /// <param name="state">Connection state.</param>
 public void Handle(ConnectionState state)
 {
     if (state == ConnectionState.Connected)
         _viewModel.IsBusy = false;
     else
         ErrorManager.Error(state.ToString());
 }
开发者ID:brainster-one,项目名称:uberball,代码行数:9,代码来源:ConnectionStateChangedBehavior.cs

示例2: fireConnectStateChange

 private void fireConnectStateChange(ConnectionState state, string message)
 {
     Trace.WriteLine("ConnectStateChange : " + state.ToString() + " " + message);
     State = state;
     if (ConnectionStateChanged != null)
     {
         ConnectionStateChangeEventArgs args = new ConnectionStateChangeEventArgs(State);
         args.Message = message;
         ConnectionStateChanged(this, args);
     }
 }
开发者ID:honj51,项目名称:ideacode,代码行数:11,代码来源:OperatorServiceAgent.cs

示例3: _pusher_ConnectionStateChanged

 static void _pusher_ConnectionStateChanged(object sender, ConnectionState state)
 {
     Console.WriteLine("Connection state: " + state.ToString());
 }
开发者ID:wiyonoaten,项目名称:pusher-websocket-dotnet,代码行数:4,代码来源:Program.cs

示例4: ConnectionStateMsg

 static private string ConnectionStateMsg(ConnectionState state)
 {
     switch (state)
     {
         case (ConnectionState.Closed):
         case (ConnectionState.Connecting | ConnectionState.Broken):
             return Res.GetString(Res.ADP_ConnectionStateMsg_Closed);
         case (ConnectionState.Connecting):
             return Res.GetString(Res.ADP_ConnectionStateMsg_Connecting);
         case (ConnectionState.Open):
             return Res.GetString(Res.ADP_ConnectionStateMsg_Open);
         case (ConnectionState.Open | ConnectionState.Executing):
             return Res.GetString(Res.ADP_ConnectionStateMsg_OpenExecuting);
         case (ConnectionState.Open | ConnectionState.Fetching):
             return Res.GetString(Res.ADP_ConnectionStateMsg_OpenFetching);
         default:
             return Res.GetString(Res.ADP_ConnectionStateMsg, state.ToString());
     }
 }
开发者ID:dotnet,项目名称:corefx,代码行数:19,代码来源:AdapterUtil.cs

示例5: _pusher_ConnectionStateChanged

        private void _pusher_ConnectionStateChanged(object sender, ConnectionState state)
        {
            ConsoleWriteLine("Connection state: " + state.ToString());

            if (state == ConnectionState.Disconnected)
            {
                RunOnUiThread(() =>
                {
                    _pusher.ConnectionStateChanged -= _pusher_ConnectionStateChanged;

                    Toast.MakeText(this, GetString(Resource.String.ToastDisconnected), ToastLength.Short).Show();

                    SetViewAndChildrenEnabled(_layoutConnectDisconnect, true);
                    SetViewAndChildrenEnabled(_layoutSendMessage, false);
                    _buttonStart.Text = GetString(Resource.String.ButtonConnect);
                    _editMessage.Hint = "";
                });
            }
        }
开发者ID:wiyonoaten,项目名称:pusher-websocket-dotnet,代码行数:19,代码来源:MainActivity.cs

示例6: RefreshConnectText

 private void RefreshConnectText(ConnectionState newState)
 {
     switch (newState)
     {
         case ConnectionState.Connected:
             UpdateNetworkStatus(false, newState.ToString());
             _connectedToServer = true;
             break;
         case ConnectionState.Disconnected:
             UpdateNetworkStatus(false, newState.ToString());
             _connectedToServer = false;
             break;
         default:
             UpdateNetworkStatus(null, newState.ToString());
             break;
     }
     _settingsPage.RefreshIsConnected(_connectedToServer);
 }
开发者ID:dirkrombauts,项目名称:SirenOfShame,代码行数:18,代码来源:MainForm.cs

示例7: ConnectionStateMsg

        private static string ConnectionStateMsg(ConnectionState state)
        {
            switch (state)
            {
                case ConnectionState.Closed:
                case (ConnectionState.Broken | ConnectionState.Connecting):
                    return System.Data.Res.GetString("ADP_ConnectionStateMsg_Closed");

                case ConnectionState.Open:
                    return System.Data.Res.GetString("ADP_ConnectionStateMsg_Open");

                case ConnectionState.Connecting:
                    return System.Data.Res.GetString("ADP_ConnectionStateMsg_Connecting");

                case (ConnectionState.Executing | ConnectionState.Open):
                    return System.Data.Res.GetString("ADP_ConnectionStateMsg_OpenExecuting");

                case (ConnectionState.Fetching | ConnectionState.Open):
                    return System.Data.Res.GetString("ADP_ConnectionStateMsg_OpenFetching");
            }
            return System.Data.Res.GetString("ADP_ConnectionStateMsg", new object[] { state.ToString() });
        }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:22,代码来源:ADP.cs

示例8: _pusher_ConnectionStateChanged

        private void _pusher_ConnectionStateChanged(object sender, ConnectionState state)
        {
            ConsoleWriteLine("Connection state: " + state.ToString());

            if (state == ConnectionState.Disconnected)
            {
                InvokeOnMainThread(() =>
                {
                    _pusher.ConnectionStateChanged -= _pusher_ConnectionStateChanged;

                    Toast.MakeText("Disconnected! Please start over again.", Toast.LENGTH_SHORT).Show();

                    SetViewAndChildrenEnabled(this.LayoutConnectDisconnect, true);
                    SetViewAndChildrenEnabled(this.LayoutSendMessage, false);
                    this.ButtonStart.SetTitle("Connect :)", UIControlState.Normal);
                    this.EditMessage.Placeholder = "";
                });
            }
        }
开发者ID:wiyonoaten,项目名称:pusher-websocket-dotnet,代码行数:19,代码来源:MainUnivViewController.cs

示例9: OpenConnectionRequired

 internal static Exception OpenConnectionRequired(string method, ConnectionState state)
 {
     return InvalidOperation(System.Data.OracleClient.Res.GetString("ADP_OpenConnectionRequired", new object[] { method, "ConnectionState", state.ToString() }));
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:4,代码来源:ADP.cs

示例10: _pusher_ConnectionStateChanged

        private void _pusher_ConnectionStateChanged(object sender, ConnectionState state)
        {
            ConsoleWriteLine("Connection state: " + state.ToString());

            if (state == ConnectionState.Disconnected)
            {
                RunOnUiThread(() =>
                {
                    _pusher.ConnectionStateChanged -= _pusher_ConnectionStateChanged;

                    ShowToast(GetString("StringToastDisconnected"), true);

                    SetViewAndChildrenEnabled(this.LayoutConnectDisconnect, true);
                    SetViewAndChildrenEnabled(this.LayoutSendMessage, false);
                    this.ButtonStart.Content = GetString("StringButtonConnect");
                    this.EditMessage.PlaceholderText = "";
                });
            }
        }
开发者ID:wiyonoaten,项目名称:pusher-websocket-dotnet,代码行数:19,代码来源:MainPage.xaml.cs

示例11: ServerConnectionStateUpdate

        private void ServerConnectionStateUpdate(ThreadPoolTimer source)
        {
            if (m_ServerConnectionState != m_Connection.ServerConnectionState)
            {
                m_ServerConnectionState = m_Connection.ServerConnectionState;

                IAsyncAction result = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
                    () =>
                    {
                        TextBlock_ServerConnectionState.Text = m_ServerConnectionState.ToString();
                    });
            }

            if (m_ConnectionState != m_Connection.State)
            {
                m_ConnectionState = m_Connection.State;

                IAsyncAction result = Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
                     () =>
                     {
                         TextBlock_PM3ConnectionState.Text = m_ConnectionState.ToString();
                     });
            }
        }
开发者ID:spinglass,项目名称:PerformantApp,代码行数:24,代码来源:MainPage.xaml.cs


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