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


C# Request.ToString方法代码示例

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


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

示例1: RequestStart

            /// <summary>
            /// State machine entry point for beginning request
            /// </summary>
            public bool RequestStart(Request request)
            {
                System.Diagnostics.Debug.WriteLine("Request Start:" + request.ToString() + " State:" + requestState.ToString());
                if (false == App.networkService.IsNetworkAvailable())
                {
                    return false;
                }

                switch (request)
                {
                    case Request.login:
                        if (null != t) t.Dispose();
                        t = new Timer(RequestTimerCallback, t, startTime, periodTime);
                        requestState = RequestState.loggingIn;
                        break;
                    case Request.logout:
                        break;
                    case Request.getToken:
                        requestState = RequestState.gettingToken;
                        break;
                    case Request.getUsers:
                        requestState = RequestState.gettingUsers;
                        break;
                    case Request.getHosts:
                        if (RequestState.idle != requestState && RequestState.gettingHosts != requestState && RequestState.gettingHost != requestState) return false;       // Todo:  Do we really need this check?
                        if (null != t) t.Dispose();
                        t = new Timer(RequestTimerCallback, t, startTime, periodTime);
                        requestState = RequestState.gettingHosts;
                        break;
                    case Request.getHost:
                        requestState = RequestState.gettingHost;
                        break;
                    case Request.getFeedback:
                        requestState = RequestState.gettingFeedback;
                        break;
                    case Request.sendFeedback:
                        break;
                    case Request.getMessages:
                        // Stay in idle state so we don't trigger RefreshHost except at end of chain
                 //                       requestState = RequestState.gettingMessages;
                        break;
                    case Request.sendMessage:
                        break;
                    case Request.replyMessage:
                         break;
                    case Request.getMessageCount:
                        break;
                    case Request.getMessageThread:
                        requestState = RequestState.gettingMessageThread;
                        break;
                    case Request.markThreadRead:
                        break;
                    default:
                        break;
                }
                return true;
            }
开发者ID:klzig,项目名称:WarmShowers-Windows,代码行数:60,代码来源:WebService.cs

示例2: RequestComplete

            /// <summary>
            /// State machine entry point for completed request
            /// </summary>
            public void RequestComplete(Request request)
            {
                // Reset the timer
                if (null != t)
                {
                    t.Change(periodTime, periodTime);
                }

                System.Diagnostics.Debug.WriteLine("RequestComplete:" + request.ToString() + " State:" + requestState.ToString());

                switch (request)
                {
                    case Request.login:
                        if (RequestState.loggingIn == requestState)
                        {   // Chain requests
                            GetToken();
                        }
                        break;
                    case Request.logout:
                        Deployment.Current.Dispatcher.BeginInvoke(() => { App.webService.logoutCompleteCallback(WebResources.LoginNew, "", ""); });
                        break;
                    case Request.getToken:
                       Deployment.Current.Dispatcher.BeginInvoke(() => { App.webService.loginCompleteCallback(); });
                       if (RequestState.gettingToken == requestState)
                        {   // Chain requests
                            requestState = RequestState.gettingHosts;
                            App.nearby.viewportCache.getHosts();   // Todo:  Fake names for screen shots
                        }
                        break;
                    case Request.getUsers:
                        requestState = RequestState.idle;
                        break;
                    case Request.getHosts:
                        // Last in a chain of requests
                        requestState = RequestState.idle;
                        break;
                    case Request.getHost:
                        if (RequestState.gettingHost == requestState)
                        {   // Chain requests
                            requestState = RequestState.gettingFeedback;
                            GetFeedback(App.nearby.host.profile.user_Result.uid);
                        }
                        break;
                    case Request.getFeedback:
                        if (RequestState.gettingFeedback == requestState)
                        {   // Chain requests
                            requestState = RequestState.gettingMessages;
                            GetMessages(false);
                        }
                        break;
                    case Request.sendFeedback:
                        Deployment.Current.Dispatcher.BeginInvoke(() => {
                            App.webService.sendFeedbackSuccessCallback();
                        });
                        break;
                    case Request.getMessages:
                        // Last in a chain of requests
                        if (RequestState.gettingMessages == requestState)
                        {
                            App.pinned.refreshHost();
                        }
                        requestState = RequestState.idle;
                        break;
                    case Request.sendMessage:
                        Deployment.Current.Dispatcher.BeginInvoke(() => {
                            App.webService.sendMessageSuccessCallback();
                        });
                        break;
                    case Request.replyMessage:
                        Deployment.Current.Dispatcher.BeginInvoke(() => {
                            App.webService.sendMessageSuccessCallback();
                        });
                       break;
                    case Request.getMessageCount:
                        break;
                    case Request.getMessageThread:
                        if (RequestState.gettingMessageThread == requestState)
                        {
                            markThreadRead();
                        }
                        break;
                    case Request.markThreadRead:
                        break;
                    default:
                        break;
                }
            }
开发者ID:klzig,项目名称:WarmShowers-Windows,代码行数:90,代码来源:WebService.cs


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