public TcpMsg.Error SendMint() { if (reqhttpData == null) { return(TcpMsg.Error.InternalError); } user.stateType = userStateType; LBD.LBDApiManager.Instance.AddLBDCmd(reqhttpData); user.processShopSlot = this; reqhttpData = null; userStateType = UserStateType.None; return(TcpMsg.Error.None); }
private void combxUserName_TextChanged(object sender, EventArgs e) { currentUserId = combxUserName.Text; if (currentUserId.Length == 0) { return; } if (currentUserId[0] == '@') { currentUserId = currentUserId.Remove(0, 1); } currentUserState = UserStateType.NEW; if (currentTableName == "") { return; } string sql = string.Format("select ip from {0} where userid = '{1}'", currentTableName, currentUserId); string _sql = string.Format("select ip from {0} where userid = '@{1}'", currentTableName, currentUserId); if (Helper.QueryHasResult(sql, Conn)) { currentUserState = UserStateType.GRANTED; } else if (Helper.QueryHasResult(_sql, Conn)) { currentUserState = UserStateType.REVOKED; } else if (subOfTableName != "") { sql = string.Format("select ip from {0} where userid = '{1}'", subOfTableName, currentUserId); _sql = string.Format("select ip from {0} where userid = '@{1}'", subOfTableName, currentUserId); if (Helper.QueryHasResult(sql, Conn)) { currentUserState = UserStateType.PARENTGRANTED; } else if (Helper.QueryHasResult(_sql, Conn)) { currentUserState = UserStateType.PARENTREVOKED; } } UpdateStatus(); }
public override ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot) { if (!CheckConsume(priceType, priceValue)) { return(ConsumeState.ConsumeState_Falied); } if (priceValue == 0) { return(ConsumeState.ConsumeState_Done); } SetPrice("", -priceValue); return(ConsumeState.ConsumeState_Done); }
private async void AccountMenuInitializer(UserStateType type = UserStateType.AccountImages) { if (!_currentUser.IsLogged) { var dialog = new MessageDialog("You need to log in first !"); await dialog.ShowAsync(); return; } LoginLabel.Text = $"Logged in as {_currentUser.UserName}"; LoginLabel.Visibility = Visibility.Visible; LoginTextBox.Visibility = Visibility.Collapsed; LoginButton.Visibility = Visibility.Collapsed; SearchBox.Visibility = Visibility.Collapsed; SectionTypeComboBox.Visibility = Visibility.Collapsed; SortTypeComboBox.Visibility = Visibility.Collapsed; SearchButton.Visibility = Visibility.Collapsed; WindowTypeComboBox.Visibility = Visibility.Collapsed; ImageViewer.Visibility = Visibility.Visible; DraggedImageStackPanel.Visibility = Visibility.Collapsed; UploadStackPanel.Visibility = Visibility.Collapsed; DragAndDropTextBlock.Visibility = Visibility.Collapsed; LoginLabel.TextAlignment = TextAlignment.Right; UploadButton.Visibility = Visibility.Collapsed; AccountInfoButton.Visibility = Visibility.Visible; AccountInfoComboBox.Visibility = Visibility.Visible; _listBox = new ListBox(); var accountEndpoint = new AccountEndpoint(_currentUser.ApiClient, _currentUser.HttpClient); IEnumerable <IGalleryImageResponseModel> images; switch (type) { case UserStateType.AccountImages: images = await accountEndpoint.GetMyImages(); break; default: images = await accountEndpoint.GetMyFavorites(); break; } ImageViewer.Content = _listBox; foreach (var image in images.Where(s => s.Height > 0 && s.Width > 0 && !string.IsNullOrEmpty(s.Link))) { _listBox.Items?.Add(new Image { Source = new BitmapImage { UriSource = new Uri(image.Link), DecodePixelHeight = 300, DecodePixelWidth = 300, }, Height = 300, Width = 300, Name = image.Id }); } }
public abstract ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot);
protected void SetMint(LBD.Msg.LBDBaseMsg req, UserStateType userStateType) { this.reqhttpData = req; this.userStateType = userStateType; }
public override ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot) { if (!CheckConsume(priceType, priceValue)) { return(ConsumeState.ConsumeState_Falied); } if (priceValue == 0) { return(ConsumeState.ConsumeState_Done); } user.stateType = userStateType; user.processShopSlot = shopSlot; if (fungibleType == Resource.FungibleType.Fungible) { user.WithdrawFungible(TokenType(), (int)priceValue); } else if (fungibleType == Resource.FungibleType.ServiceToken) { user.WithdrawServiceToken((int)priceValue); } return(ConsumeState.ConsumeState_Request_Burn); }
public UserResultStatistic() { m_ULPowerList = new List<float>(); m_UlThorughput = new List<float>(); m_DlThorughput = new List<float>(); //m_DLOtherNetTypeInterf = new List<float>(); //m_ULOtherNetTypeInterf = new List<float>(); m_DLTDInterf = new List<float>(); m_ULTDInterf = new List<float>(); m_DLUMTSInterf = new List<float>(); m_ULUMTSInterf = new List<float>(); m_UserState = UserStateType.Fail; }
internal UserState(UserStateType userStateType, int codecStreamCount) { UserStateType = userStateType; CodecStreamCount = codecStreamCount; }