コード例 #1
0
        private async void CancelAnonymousMethod()
        {
            #region Checking Network

            if (false == Utility.Instance.IsNetworkAvailable)
            {
                ToasteIndicator.Instance.Show(String.Empty, "网络连接已中断", null, 3);

                return;
            }

            #endregion

            if (null == _questionService || Relationship == null)
            {
                return;
            }

            var result = await _questionService.CancelAnonymousAsync(LoginUser.Current.Token, Id);

            if (result == null)
            {
                return;
            }

            if (null != result.Error)
            {
                ToasteIndicator.Instance.Show(String.Empty, result.Error.Message, null, 3);

                Debug.WriteLine(Regex.Unescape(result.Error.Message));

                return;
            }

            Relationship.IsAnonymous = result.Result.IsAnonymous;
        }