コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: uvbs/FullSource
        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();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: viticm/pap2
        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();
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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
                });
            }
        }
コード例 #6
0
 public abstract ConsumeState Consume(Resource.PriceType priceType, Int64 priceValue, string walletaddr, UserStateType userStateType, ShopSlot shopSlot);
コード例 #7
0
 protected void SetMint(LBD.Msg.LBDBaseMsg req, UserStateType userStateType)
 {
     this.reqhttpData   = req;
     this.userStateType = userStateType;
 }
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: UserResultStatistic.cs プロジェクト: xiaoyj/Space
 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;
 }
コード例 #10
0
 internal UserState(UserStateType userStateType, int codecStreamCount)
 {
     UserStateType    = userStateType;
     CodecStreamCount = codecStreamCount;
 }