///<summary>
 ///</summary>
 ///<param name="source"></param>
 ///<param name="generator"></param>
 public ConverterAdaptorVcgen(IVertexSource source, IGenerator generator)
 {
     _markers = new NullMarkers();
     _source = source;
     _generator = generator;
     _status = EStatus.Initial;
 }
        public void ChangeStatus(Guid offerId, EStatus status)
        {
            var offer = _offerRepository.Get(offerId);
            if (offer == null) throw new ArgumentNullException("Offer does not exist");

            offer.Status = status;
            _offerRepository.SaveOrUpdate(offer);
            _offerRepository.DbContext.CommitChanges();
        }
 internal void ClearAllStatus(EStatus a_type)
 {
     foreach (StatusWrapper CurrentStatus in _status.Values)
     {
         if (CurrentStatus.status.type == a_type)
         {
             RemoveStatus (CurrentStatus);
         }
     }
 }
 internal bool CheckStatus(EStatus Type)
 {
     foreach (StatusWrapper CurrentStatu in _status.Values)
     {
         if (CurrentStatu.status.type == Type)
         {
             return true;
         }
     }
     return false;
 }
 private void Update()
 {
     if (buildingGenerationStatus == EStatus.hasNotStarted)
     {
         // FIND SOMETHING BETTER
         GameObject instance = GameObject.FindWithTag("MapGenerator");
         if (instance.GetComponent <IslandGenerator>().FinishedTerrainGeneration())
         {
             buildingGenerationStatus = EStatus.start;
         }
     }
     if (buildingGenerationStatus == EStatus.start)
     {
         GenerateBuildings();
         buildingGenerationStatus = EStatus.completed;
     }
 }
Exemple #6
0
        public void Rewind(uint nothing)
        {
            m_status = EStatus.initial;
            if (m_font == null)
            {
                return;
            }

            m_StartOfIndicesIndex = Value(0);

            double base_height = Value(4);

            m_StartOfGlyphsIndex    = m_StartOfIndicesIndex + 257 * 2;          // one for x one for y
            m_HeightScaleRatio      = m_FontSize / base_height;
            m_WidthScaleRatio       = m_HeightScaleRatio * m_WidthRatioOfHeight;
            m_CurrentCharacterIndex = 0;
        }
 void Restart()
 {
     Message.text = "Wait to reconnect.";
     if (PauseScreen != null)
     {
         PauseScreen.gameObject.SetActive(true);
     }
     CalibrationScreen.gameObject.SetActive(false);
     _status   = EStatus.EWaiting;
     _currPage = 0;
     _currTime = DateTime.Now;
     if (UserStudy)
     {
         _modes[_currPage] = DS.IsFoveatedStreaming() ? EMode.EFoveated : EMode.EFull;
     }
     Body.RobotConnector.EndUpdate();
 }
Exemple #8
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            EStatus status = EStatus.成功;
            string  requestParametersString = RequestInputStreamToString(filterContext.HttpContext.Request.InputStream);

            if (string.IsNullOrEmpty(requestParametersString))
            {
                status = EStatus.未授权;
                EndResult(filterContext, status);
                return;
            }

            DicParameters = JsonConvert.DeserializeObject <Dictionary <string, object> >(requestParametersString);

            //签名认证
            if (IsSign)
            {
                SignHelper signHelper = new SignHelper(Config.Instance.SignKey, DicParameters);
                if (signHelper.CheckSign() == false)
                {
                    status = EStatus.签名错误;
                    EndResult(filterContext, status);
                    return;
                }
            }

            //授权认证
            if (DicParameters.ContainsKey("access_token") == false)
            {
                status = EStatus.未授权;
                EndResult(filterContext, status);
                return;
            }

            var accessToken = DicParameters["access_token"].ToString();
            var oauth       = _OAuthBLL.GetByAccessToken(accessToken);

            if (oauth == null || DateTime.Now > oauth.ExpireTime)
            {
                status = EStatus.未授权;
                EndResult(filterContext, status);
                return;
            }

            base.OnActionExecuting(filterContext);
        }
Exemple #9
0
        public void InvokeAnimate(float t)
        {
            if (Control == null || Control.IsDisposed)
            {
                Status = EStatus.Finished;
                return;
            }

            if (_Animate == null)
            {
                _Animate = Animate;
            }
            try {
                Control.BeginInvoke(_Animate, t);
            } catch {
                Status = EStatus.Finished;
            }
        }
 public CreatePlanCommandResult(Guid id, string companyId, string sponsorId, string planId, string branchId, string employeeId, DateTime initial, DateTime admission, DateTime suspension, DateTime dismissal, DateTime inclusion, DateTime alteracion, EStatus status, bool isRegressive, DateTime?regressiveDate)
 {
     Id             = id;
     CompanyId      = companyId;
     SponsorId      = sponsorId;
     PlanId         = planId;
     BranchId       = branchId;
     EmployeeId     = employeeId;
     Initial        = initial;
     Admission      = admission;
     Suspension     = suspension;
     Dismissal      = dismissal;
     Inclusion      = inclusion;
     Alteracion     = alteracion;
     Status         = status;
     IsRegressive   = isRegressive;
     RegressiveDate = regressiveDate;
 }
Exemple #11
0
        public override void OnMouseEnter(MouseEvent me)
        {
            //base.OnMouseEnter(me);

            isHover = true;
            if (menuBar.IsExpand)
            {
                menuBar.SetExpand(this);
                expand = true;
            }
            else
            {
                if (!expand)
                {
                    status = EStatus.Hover;
                }
            }
        }
Exemple #12
0
        public MenuItemSubMenu(String text)
        {
            Text          = text;
            this.textFont = new Text("MenuItemSubMenu", UI.Instance.CurrentTheme.defaultTextFont, text);
            //this.textFont = textFont;
            status   = EStatus.Normal;
            expand   = false;
            Left     = 24;
            Top      = 2;
            Bottom   = 4;
            Right    = 2;
            menuList = new MenuList();

            Size = GetPreferedSize();

            menuList.Position.X = 232 - 9;
            menuList.Position.Y = 0;
        }
Exemple #13
0
        public Produto(
            string cod_Produto,
            string des_Produto,
            EStatus sta_Status)
        {
            Cod_Produto    = cod_Produto;
            Des_Produto    = des_Produto;
            Sta_Status     = sta_Status;
            _produtosCosif = new List <ProdutoCosif>();

            AddNotifications(new ValidationContract()
                             .Requires()
                             .HasMaxLen(Cod_Produto, 4, "Cod_Produto", "O campo Cod_Produto deve conter no máximo 4 caracteres")
                             .HasMinLen(Cod_Produto, 1, "Cod_Produto", "O campo Cod_Produto deve conter no mínimo 1 caracteres")
                             .HasMaxLen(Des_Produto, 30, "Des_Produto", "O campo Des_Produto deve conter no máximo 30 caracteres")
                             .HasMinLen(Des_Produto, 3, "Des_Produto", "O campo Des_Produto deve conter no mínimo 3 caracteres")
                             );
        }
        private void btnXoaNhanVienQuaTrai_Click(object sender, EventArgs e)
        {
            if (rowPhanQuyenSelected == -1)
            {
                return;
            }

            string uName = layTextGridView(gvPhanNhanVienVaoNhomQuyen, rowPhanQuyenSelected, PhanNguoiDungVaoNhomQuyen_DTO.COL_USERNAME);

            if (string.IsNullOrEmpty(uName))
            {
                hienThiThongBaoLoi("Chọn ngừoi dùng để xoá bị lỗi");
                return;
            }

            var maNhom = cboxNhomQuyen.SelectedValue;

            if (maNhom == null)
            {
                hienThiThongBaoLoi("Chưa chọn nhóm quyền!");
                return;
            }

            //Chắc chắn?
            string       mess = string.Format("Sắp xóa ngừoi dùng {0} tại nhóm {1}", uName, cboxNhomQuyen.SelectedItem);
            DialogResult res  = hienThiCauHoiYesNo(mess);

            if (res == DialogResult.No)
            {
                return;
            }

            EStatus status = pND_NQ_DAL_BLL.xoa(uName, maNhom.ToString());

            if (status == EStatus.THANH_CONG)
            {
                hienThiThongBaoThanhCong("Xóa Người Dùng thành công");
                loadNhanVienTheoNhom();
            }
            else
            {
                hienThiThongBaoLoi("Đã Gặp lỗi xóa ngừoi dùng khỏi nhóm!");
            }
        }
Exemple #15
0
        public string NotifyInitAction(string text)
        {
            this._status         = EStatus.Connected;
            this._commandReady   = false;
            this._terminateReady = false;



            //int iSpace = text.IndexOf(' ');
            //if (iSpace == -1)
            //    return null;


            //string address = text.Substring(0, iSpace);
            //string info = text.Substring(iSpace + 1);

            this.richTextBoxInfo.Invoke((MethodInvoker) delegate
            {
                this.richTextBoxInfo.Text = text;
            });

            this.textBoxStatus.Invoke((MethodInvoker) delegate
            {
                this.textBoxStatus.Text = STATUS_NAMES[(int)this._status];
            });

            this.textBoxCommand.Invoke((MethodInvoker) delegate
            {
                this.textBoxCommand.ReadOnly = false;
            });

            this.buttonExecute.Invoke((MethodInvoker) delegate
            {
                this.buttonExecute.Visible = true;
            });

            this.buttonTerminate.Invoke((MethodInvoker) delegate
            {
                this.buttonTerminate.Visible = true;
            });


            return(string.Empty);
        }
Exemple #16
0
        private void _FieldSelected(bool jokerUsed = false)
        {
            if (!jokerUsed)
            {
                int singerTeam1 = 0;
                int singerTeam2 = 0;

                if (_PartyMode.GameData.PlayerTeam1.Count > 0)
                {
                    singerTeam1 = _PartyMode.GameData.PlayerTeam1[0];
                    _PartyMode.GameData.PlayerTeam1.RemoveAt(0);
                }

                if (_PartyMode.GameData.PlayerTeam2.Count > 0)
                {
                    singerTeam2 = _PartyMode.GameData.PlayerTeam2[0];
                    _PartyMode.GameData.PlayerTeam2.RemoveAt(0);
                }
                _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam1 = singerTeam1;
                _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam2 = singerTeam2;

                _UpdatePlayerInformation();
            }
            _PartyMode.UpdateSongList();
            int[] songIDs = new int[_PartyMode.GameData.GameMode == EGameMode.TR_GAMEMODE_MEDLEY ? _PartyMode.GameData.NumMedleySongs : 1];
            for (int i = 0; i < songIDs.Length; i++)
            {
                songIDs[i] = _PartyMode.GameData.Songs[0];
                _PartyMode.GameData.Songs.RemoveAt(0);
            }

            _StartPreview(songIDs[0]);
            _Status = EStatus.FieldSelected;
            _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SongIDs = songIDs;
            _UpdateFieldContents();
            _UpdateJokerButtons();

            _Buttons[_ButtonNextRound].Visible = true;
            _Buttons[_ButtonExit].Visible      = true;
            _Buttons[_ButtonBack].Visible      = false;

            _SelectElement(_Buttons[_ButtonNextRound]);
        }
        private void showStatus(EStatus status)
        {
            if (status == EStatus.Reset)
            {
                lbSaved.Content    = "Zurückgesetzt ...";
                lbSaved.Foreground = Brushes.DarkRed;
            }
            else if (status == EStatus.Save)
            {
                lbSaved.Content    = "Gespeichert ...";
                lbSaved.Foreground = Brushes.DarkGreen;
            }

            lbSaved.Visibility = Visibility.Visible;
            Task.Delay(2000).ContinueWith(t =>
            {
                lbSaved.Visibility = Visibility.Hidden;
            }, TaskScheduler.FromCurrentSynchronizationContext());
        }
Exemple #18
0
        private void _FieldSelectedAgain()
        {
            int[] songIDs = _PartyMode.GameData.Rounds[_OldSelectedField].SongIDs;
            _StartPreview(songIDs[0]);
            _Status = EStatus.FieldSelected;
            _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SongIDs     = songIDs;
            _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam1 = _PartyMode.GameData.Rounds[_OldSelectedField].SingerTeam1;
            _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam2 = _PartyMode.GameData.Rounds[_OldSelectedField].SingerTeam2;
            _UpdateFieldContents();

            _UpdatePlayerInformation();
            _UpdateJokerButtons();

            _Buttons[_ButtonNextRound].Visible = true;
            _Buttons[_ButtonExit].Visible      = true;
            _Buttons[_ButtonBack].Visible      = false;

            _SelectElement(_Buttons[_ButtonNextRound]);
        }
Exemple #19
0
    /// <summary>
    /// Draws the Chunk based on its Blockdata.
    /// Adds a CollisionMesh equal to the ChunkMesh
    /// </summary>
    public void DrawChunk()
    {
        for (int z = 0; z < World.CHUNKSIZE; z++)
        {
            for (int y = 0; y < 2; y++)
            {
                for (int x = 0; x < World.CHUNKSIZE; x++)
                {
                    m_ChunkData[x, y, z].Draw();
                }
            }
        }
        CombineQuads();
        MeshCollider collider = m_Chunk.gameObject.AddComponent(typeof(MeshCollider)) as MeshCollider;

        collider.sharedMesh = m_Chunk.transform.GetComponent <MeshFilter>().mesh;

        m_CurrentStatus = EStatus.DONE;
    }
Exemple #20
0
        public override void Init()
        {
            if (Status != EStatus.Uninitialized)
            {
                return;
            }

            OnInit();

            if (AutoStart)
            {
                Start();
                Animate(0f);
            }
            else
            {
                Status = EStatus.Finished;
            }
        }
Exemple #21
0
        public string NotifyTerminate(string text)
        {
            this._status         = EStatus.Disconnected;
            this._commandReady   = false;
            this._terminateReady = false;


            this.textBoxCommand.Invoke((MethodInvoker) delegate
            {
                this.textBoxCommand.Text     = string.Empty;
                this.textBoxCommand.ReadOnly = true;
                this.buttonExecute.Visible   = false;
                this.buttonTerminate.Visible = false;
                this.textBoxStatus.Text      = STATUS_NAMES[(int)this._status];
            });


            return(string.Empty);
        }
Exemple #22
0
        public Produto Produto(string codProduto, EStatus status)
        {
            _context.AdicionarParametro("@Cod_Produto", SqlDbType.Char, codProduto);
            _context.AdicionarParametro("@Sta_Status", SqlDbType.Char, status);

            var dataTable = _context.ExecutarConsulta("spObterProduto");

            if (dataTable.Rows.Count == 0)
            {
                return(null);
            }

            var produto = new Produto(
                dataTable.Rows[0]["Cod_Produto"].ToString(),
                dataTable.Rows[0]["Des_Produto"].ToString(),
                dataTable.Rows[0]["Sta_Status"].ToString() == "A" ? EStatus.A : EStatus.I);

            return(produto);
        }
Exemple #23
0
    public IEnumerator Closing_Padding()
    {
        CurrentStatus = EStatus.Closing_Padding;
        float PaddingRight = LayoutComponent.padding.right;

        while (LayoutComponent.padding.right != LayoutCloseOffset)
        {
            PaddingRight           += (int)(MovingSpeed * Time.deltaTime);
            PaddingRight            = Mathf.Clamp(PaddingRight, 0, LayoutCloseOffset);
            LayoutComponent.padding = new RectOffset(0, (int)PaddingRight, 0, 0);
            LayoutComponent.CalculateLayoutInputHorizontal();
            yield return(null);
        }

        LayoutComponent.padding = new RectOffset();
        LayoutComponent.CalculateLayoutInputHorizontal();

        yield return(Closing_Scaling());
    }
Exemple #24
0
        public void SaveScaleLine(string line)
        {
            try
            {
                if (IsNegativeLine(line))
                {
                    return;
                }

                if (ZeroLine(line))
                {
                    if (LastLine.Line != string.Empty)
                    {
                        Status = EStatus.Working;
                        SaveScaleLine();
                    }

                    LastLine.Line = string.Empty;
                    return;
                }

                if (!IsStableLine(line))
                {
                    return;
                }
                if (!IsValidWeigth(line))
                {
                    return;
                }
                if (!IsDistinctLine(line))
                {
                    return;
                }

                LastLine.Line = line;
                LastLine.Date = DateTime.Now;
            }
            catch (Exception ex)
            {
                MyLogger.LogException(ex, "ScalesMng::SaveScaleLine");
            }
        }
    void Update()
    {
        //        Debug.Log("be update");
        if (Input.GetMouseButtonDown(0))
        {
            if (DoRayCast())
            {
                desireDirectory = hit.point - transform.position;
                targetPoint = hit.point;
                rvo.Move(desireDirectory.normalized * moveSpd);
                //Debug.Log(dir.normalized * moveSpd);
                rvo.maxSpeed = moveSpd;
                status = EStatus.running;
                nowDistance = lastDistance = Vector3.Distance(transform.position, hit.point);
                //Debug.LogWarning("nowDistance = lastDistance " + nowDistance + " " + transform.position);
                if (isStartBreak)
                {
                    Debug.Break();
                }
                
            }
        }
        if (status == EStatus.running)
        {
            Vector3 movevec = hit.point - transform.position;
            Vector2 firstObject = new Vector2(desireDirectory.x, desireDirectory.z);
            Vector2 secondObject = new Vector2(movevec.x, movevec.z);
            float det = firstObject.x * secondObject.y - firstObject.y * secondObject.x;
            if (Vector3.Dot(movevec, desireDirectory)<0)
            {
                if (arriveBreak)
                {
                    Debug.Break();
                }
       
                rvo.Move(Vector3.zero);
                status = EStatus.stop;
            }
            
        }

    }
Exemple #26
0
        public GsvText()
        {
            m_CurrentX = 0.0;
            m_CurrentY = 0.0;
            m_StartX = 0.0;
            m_WidthRatioOfHeight = 1;
            m_FontSize = 0.0;
            m_SpaceBetweenCharacters = 0.0;
            m_font = CGSVDefaultFont.gsv_default_font;
            m_status = EStatus.initial;
            m_big_endian = false;

            m_SpaceBetweenLines = 0.0;

            int t = 1;
            unsafe
            {
                if (*(byte*)&t == 0) m_big_endian = true;
            }
        }
Exemple #27
0
    public static void StartCalibration()
    {
        if (OnCalibrationStarted != null)
        {
            OnCalibrationStarted();
        }
        else
        {
            print("No 'calibration started' delegate set");
        }

        Settings.calibration.InitializeCalibration();

        stateBeforeCalibration = DataProcessState;
        DataProcessState       = EStatus.Calibration;

        byte[] calibrationData = new byte[1 + 2 * sizeof(ushort) + sizeof(float)];
        calibrationData [0] = (byte)'C';
        ushort hmdVideoFrameSize = 1000;

        byte[] frameSizeData = System.BitConverter.GetBytes(hmdVideoFrameSize);
        for (int i = 0; i < 2; i++)
        {
            for (int j = 0; j < sizeof(ushort); j++)
            {
                calibrationData [1 + i * sizeof(ushort) + j] = frameSizeData [j];
            }
        }
        float outlierThreshold = 35;

        byte[] outlierThresholdData = System.BitConverter.GetBytes(outlierThreshold);
        for (int i = 0; i < sizeof(float); i++)
        {
            calibrationData [1 + 2 * sizeof(ushort) + i] = outlierThresholdData [i];
        }
        Connection.sendData(calibrationData);

        _calibrationData.Clear();

        RepaintGUI();
    }
    void Pause()
    {
        if (UserStudy)
        {
            if (_currPage >= NumberOfPages)
            {
                return;
            }
        }
        if (PauseScreen != null)
        {
            PauseScreen.gameObject.SetActive(true);
        }
        CalibrationScreen.gameObject.SetActive(false);
        _status = EStatus.EWaiting;
        if (UserStudy)
        {
            _timePerPage[_currPage] = (DateTime.Now - _currTime).Duration().TotalSeconds;

            _currTime = DateTime.Now;

            _dbWriter.AddData("Length", _timePerPage[_currPage].ToString());
            _dbWriter.AddData("Mode", _modes[_currPage].ToString());
            _dbWriter.PushData();

            _currPage++;
            if (_currPage >= NumberOfPages)
            {
                string path  = string.Format(Application.dataPath + "/Experiments/Foveated{0}.xls", _nextFileID);
                string path2 = string.Format(Application.dataPath + "/Experiments/Head{0}.xls", _nextFileID);
                ++_nextFileID;
                _dbWriter.WriteValues(path);
                _dbWriter.ClearData();
                _dbHeadWriter.WriteValues(path2);
                _dbHeadWriter.ClearData();
                Message.text = "Done, thank you.";
            }
        }

        Body.RobotConnector.EndUpdate();
    }
Exemple #29
0
 public IndexProductAdapter
 (
     Guid id,
     string name,
     string description,
     decimal price,
     int quantity,
     Guid categoryId,
     string categoryName,
     EStatus status
 )
 {
     Id           = id;
     Name         = name;
     Description  = description;
     Price        = price;
     Quantity     = quantity;
     CategoryId   = categoryId;
     CategoryName = categoryName;
     Status       = status;
 }
Exemple #30
0
        /// <summary>
        /// 设置收缩
        /// </summary>
        internal void setFold()
        {
            switch (curStatus)
            {
            case EStatus.none:
                operate   = EOperate.模型加入;
                oprStatus = EStatus.收缩;
                break;

            case EStatus.扩张:
                Merge();
                operate   = EOperate.模型加入;
                oprStatus = EStatus.收缩;
                break;

            case EStatus.收缩:
                operate = EOperate.模型更新;
                //operate = EOperate.none;
                break;
            }
        }
Exemple #31
0
        public static List <OptionTradingData> GetOptionTradingDataList(string symbol, DateTime expiryDate,
                                                                        EStatus status = EStatus.Open)
        {
            var optionTradingDataList = new List <OptionTradingData>();
            var optionDataList        = GetOptionDataList(symbol, expiryDate);

            var unlOptionsList = GetUnlOptions(symbol, expiryDate, status);

            foreach (var uo in unlOptionsList)
            {
                var option = optionDataList.FirstOrDefault(od => od.OptionKey == uo.OptionKey);
                if (option == null)
                {
                    continue;
                }
                optionTradingDataList.Add(new OptionTradingData(option, uo));
            }
            //var x = optionTradingDataList[0].DiffDays;
            //var b = optionTradingDataList[0].UnlOptions.OpenTransaction.OrderStatus.LastFillPrice;
            return(optionTradingDataList);
        }
        public ProdutoCosif(
            Produto produto,
            string cod_Cosif,
            string cod_Classificacao,
            EStatus sta_Status)
        {
            Produto            = produto;
            Cod_Cosif          = cod_Cosif;
            Cod_Classificacao  = cod_Classificacao;
            Sta_Status         = sta_Status;
            _movimentosManuais = new List <MovimentoManual>();

            AddNotifications(new ValidationContract()
                             .Requires()
                             .IsNotNull(Produto, "Produto", "Ao menos um produto deve ser informado")
                             .HasMaxLen(Cod_Cosif, 11, "Cod_Cosif", "O campo Cod_Cosif deve conter no máximo 11 caracteres")
                             .HasMinLen(Cod_Cosif, 1, "Cod_Cosif", "O campo Cod_Cosif deve conter no mínimo 1 caracter")
                             .HasMaxLen(Cod_Classificacao, 6, "Cod_Classificacao", "O campo Cod_Classificacao deve conter no máximo 6 caracteres")
                             .HasMinLen(Cod_Classificacao, 1, "Cod_Classificacao", "O campo Cod_Classificacao deve conter no mínimo 1 caracter")
                             );
        }
Exemple #33
0
        public void OpenOperation(
            Pair pair,
            EType type,
            DateTime initialDate,
            decimal entryPoint,
            decimal partial,
            decimal target,
            decimal stop,
            double riskManagement,
            EModality modality,
            Quantity quantity
            )
        {
            IdOperation = Guid.NewGuid().ToString();
            Status      = EStatus.Open;

            Pair           = pair;
            Type           = type;
            InitialDate    = initialDate;
            EntryPoint     = entryPoint;
            Partial        = partial;
            Target         = target;
            Stop           = stop;
            RiskManagement = riskManagement;
            Modality       = modality;
            Quantity       = quantity;

            if (Quantity.QuantityCrypto <= 0.00000000m)
            {
                AddNotification("Invalidquantity", "O montante precisa ser maior que 0.00000000 (1 satoshi)");
            }
            if (RiskManagement <= 0)
            {
                AddNotification("InvalidRisk", "O G.R. não pode ser igual ou inferior a 0% do capital.");
            }
            if (RiskManagement > 100)
            {
                AddNotification("InvalidRisk", "O G.R. não pode ser superior a 100% do capital.");
            }
        }
        public ActionResult PromenaStatusaVoznje(EStatus status)
        {
            foreach (KeyValuePair <string, Voznja> kv in getVoznje)
            {
                if (kv.Value.Vozac.KorisnickoIme != null)
                {
                    if (kv.Value.Vozac.KorisnickoIme.Equals(((Vozac)Session["Ulogovan"]).KorisnickoIme) && !(kv.Value.StatusVoznje == EStatus.USPESNA || kv.Value.StatusVoznje == EStatus.NEUSPESNA))
                    {
                        ((Vozac)Session["Ulogovan"]).Zauzet = false;
                        if (status == EStatus.NEUSPESNA)
                        {
                            kv.Value.StatusVoznje = status;
                            ViewBag.voznja        = kv.Value;
                            return(View("Komentar"));
                        }
                        else
                        {
                            return(View("OdredisteUnos"));
                        }
                    }
                }
            }
            int i = 0;

            foreach (KeyValuePair <string, Voznja> kv in getVoznje)
            {
                try
                {
                    if (kv.Value.Vozac.KorisnickoIme.Equals((((Korisnik)Session["Ulogovan"]).KorisnickoIme)))
                    {
                        i++;
                    }
                }
                catch
                {
                }
            }
            ViewBag.broj = i;
            return(View("HomepageVozac"));
        }
Exemple #35
0
        private void _FieldSelected(bool jokerUsed = false)
        {
            if (!jokerUsed)
            {
                int singerTeam1 = 0;
                int singerTeam2 = 0;

                if (_PartyMode.GameData.PlayerTeam1.Count > 0)
                {
                    singerTeam1 = _PartyMode.GameData.PlayerTeam1[0];
                    _PartyMode.GameData.PlayerTeam1.RemoveAt(0);
                }

                if (_PartyMode.GameData.PlayerTeam2.Count > 0)
                {
                    singerTeam2 = _PartyMode.GameData.PlayerTeam2[0];
                    _PartyMode.GameData.PlayerTeam2.RemoveAt(0);
                }
                _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam1 = singerTeam1;
                _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SingerTeam2 = singerTeam2;

                _UpdatePlayerInformation();
            }
            _PartyMode.UpdateSongList();
            int songID = _PartyMode.GameData.Songs[0];

            _PartyMode.GameData.Songs.RemoveAt(0);

            _StartPreview(songID);
            _Status = EStatus.FieldSelected;
            _PartyMode.GameData.Rounds[_PartyMode.GameData.FieldNr].SongID = songID;
            _UpdateFieldContents();
            _UpdateJokerButtons();

            _Buttons[_ButtonNextRound].Visible = true;
            _Buttons[_ButtonExit].Visible      = true;
            _Buttons[_ButtonBack].Visible      = false;

            _SelectElement(_Buttons[_ButtonNextRound]);
        }
Exemple #36
0
        public Menu(String text)
        {
            Text = text;
            this.textFont = new Text("Menu", UI.Instance.CurrentTheme.defaultTextFont, text);
            float w, h;
            Size = new Size(23, 10);
            //Size=Font::FontEngine::getSingleton().getFont().getStringBoundingBox(textFont);
            UI.Instance.CurrentTheme.defaultTextFont.MeasureString(text, out w, out h);
            Size.width = (uint)w;
            Size.height = (uint)h;

            Size.width += 10;
            Size.height = 20;
            Position.X = 100;
            Position.Y = 100;

            status = EStatus.Normal;
            expand = false;

            menuList.Position.X = -9;
            menuList.Position.Y = 25;
        }
Exemple #37
0
        /// <summary>
        /// 设置扩展,并生成下一级子节点
        /// </summary>
        internal void setExpand()
        {
            switch (curStatus)
            {
            case EStatus.none:
                Split();
                operate   = EOperate.none;
                oprStatus = EStatus.扩张;
                break;

            case EStatus.扩张:
                Split();
                operate = EOperate.none;
                break;

            case EStatus.收缩:
                Split();
                operate   = EOperate.模型删除;
                oprStatus = EStatus.扩张;
                break;
            }
        }
Exemple #38
0
        public void Rewind(uint nothing)
        {
            m_status = EStatus.initial;
            if (m_font == null) return;

            m_StartOfIndicesIndex = Value(0);

            double base_height = Value(4);
            m_StartOfGlyphsIndex = m_StartOfIndicesIndex + 257 * 2; // one for x one for y
            m_HeightScaleRatio = m_FontSize / base_height;
            m_WidthScaleRatio = m_HeightScaleRatio * m_WidthRatioOfHeight;
            m_CurrentCharacterIndex = 0;
        }
Exemple #39
0
 internal BunnyHopStatus(EStatus a_type, float a_duration)
     : base(a_type, a_duration)
 {
 }
 ///<summary>
 ///</summary>
 ///<param name="pathId"></param>
 public void Rewind(uint pathId)
 {
     _source.Rewind(pathId);
     _status = EStatus.Initial;
 }
        ///<summary>
        ///</summary>
        ///<param name="x"></param>
        ///<param name="y"></param>
        ///<returns></returns>
        public uint Vertex(out double x, out double y)
        {
            x = 0;
            y = 0;
            uint cmd = (uint)Path.EPathCommands.Stop;
            bool done = false;
            while (!done)
            {
                switch (_status)
                {
                    case EStatus.Initial:
                        Initial();
                        goto case EStatus.Accumulate;

                    case EStatus.Accumulate:
                        if (Path.IsStop(_lastCommand)) return (uint)Path.EPathCommands.Stop;
                        Accumulate(ref cmd, ref x, ref y);
                        goto case EStatus.Generate;

                    case EStatus.Generate:
                        cmd = _generator.Vertex(ref x, ref y);
                        if (Path.IsStop(cmd))
                        {
                            _status = EStatus.Accumulate;
                            break;
                        }
                        done = true;
                        break;
                }
            }
            return cmd;
        }
        private void Accumulate(ref uint cmd, ref double x, ref double y)
        {
            _generator.RemoveAll();
            _generator.AddVertex(_startX, _startY, (uint)Path.EPathCommands.MoveTo);
            _markers.AddVertex(_startX, _startY, (uint)Path.EPathCommands.MoveTo);

            for (; ; )
            {
                cmd = _source.Vertex(out x, out y);
                if (Path.IsVertex(cmd))
                {
                    _lastCommand = cmd;
                    if (Path.IsMoveTo(cmd))
                    {
                        _startX = x;
                        _startY = y;
                        break;
                    }
                    _generator.AddVertex(x, y, cmd);
                    _markers.AddVertex(x, y, (uint)Path.EPathCommands.LineTo);
                }
                else
                {
                    if (Path.IsStop(cmd))
                    {
                        _lastCommand = (uint)Path.EPathCommands.Stop;
                        break;
                    }
                    if (Path.IsEndPoly(cmd))
                    {
                        _generator.AddVertex(x, y, cmd);
                        break;
                    }
                }
            }
            _generator.Rewind(0);
            _status = EStatus.Generate;
        }
Exemple #43
0
        public override void OnMousePress(AssortedWidgets.Events.MouseEvent me)
        {
            //base.OnMousePress(me);

            status = EStatus.Pressed;
        }
        //==================================================================================
        // ====================================================================================
        // 以下シングルトン宣言
        private void initialize()
        {
            m_eConnect = EConnect.DISCONNECT;
            m_eStatus = EStatus.SLEEP;
            m_bErrorLog = false;

            SESSION_ERROR = false;

            m_intTimeoutTime = TIMEOUT_TIME;

            IsMaintenance = false;
            m_dictNetworkData.Clear ();

            return;
        }
Exemple #45
0
        public override void OnMousePress(MouseEvent me)
        {
            //base.OnMousePress(me);

            status = EStatus.Pressed;
        }
Exemple #46
0
        public override void OnMouseRelease(MouseEvent me)
        {
            //base.OnMouseRelease(me);

            if (expand)
            {
                parentMenuList.SetShrink();
                expand = false;
            }
            else
            {
                parentMenuList.SetExpand(this);
                expand = true;
            }
            status = EStatus.Hover;
        }
Exemple #47
0
 internal FireStatus(EStatus a_type, float a_duration)
     : base(a_type, a_duration)
 {
 }
Exemple #48
0
        public override void OnMouseRelease(AssortedWidgets.Events.MouseEvent me)
        {
            //base.OnMouseRelease(me);

            status = EStatus.Normal;
            MenuBar.Instance.SetShrink();
        }
Exemple #49
0
        public override void OnMouseEnter(AssortedWidgets.Events.MouseEvent me)
        {
            //base.OnMouseEnter(me);

            isHover = true;
            status = EStatus.Hover;
        }
Exemple #50
0
        public uint Vertex(out double x, out double y)
        {
            x = 0;
            y = 0;
            bool quit = false;

            while (!quit)
            {
                switch (m_status)
                {
                    case EStatus.initial:
                        if (m_font == null)
                        {
                            quit = true;
                            break;
                        }
                        m_status = EStatus.next_char;
                        goto case EStatus.next_char;

                    case EStatus.next_char:
                        if (m_CurrentCharacterIndex == m_Text.Length)
                        {
                            quit = true;
                            break;
                        }
                        int maskedChracter = (int)((m_Text[m_CurrentCharacterIndex++]) & 0xFF);
                        if (maskedChracter == '\r' || maskedChracter == '\n')
                        {
                            m_CurrentX = m_StartX;
                            m_CurrentY -= m_FontSize + m_SpaceBetweenLines;
                            break;
                        }
                        int maskedChracterGlyphIndex = maskedChracter * 2; // we have an x and y in the array so it's * 2.
                        m_BeginGlyphIndex = m_StartOfGlyphsIndex + Value(m_StartOfIndicesIndex + maskedChracterGlyphIndex);
                        m_EndGlyphIndex = m_StartOfGlyphsIndex + Value(m_StartOfIndicesIndex + maskedChracterGlyphIndex + 2);
                        m_status = EStatus.start_glyph;
                        goto case EStatus.start_glyph;

                    case EStatus.start_glyph:
                        x = m_CurrentX;
                        y = m_CurrentY;
                        m_status = EStatus.glyph;
                        return (uint)Path.EPathCommands.MoveTo;

                    case EStatus.glyph:
                        if (m_BeginGlyphIndex >= m_EndGlyphIndex)
                        {
                            m_status = EStatus.next_char;
                            m_CurrentX += m_SpaceBetweenCharacters;
                            break;
                        }

                        sbyte IsAMoveTo_Flag;
                        unsafe
                        {
                            unchecked
                            {
                                sbyte yc;
                                fixed (byte* pFont = m_font)
                                {
                                    sbyte* pFontSByte = (sbyte*)pFont;
                                    int DeltaX = (int)(pFontSByte[m_BeginGlyphIndex++]);
                                    IsAMoveTo_Flag = (sbyte)((yc = pFontSByte[m_BeginGlyphIndex++]) & 0x80);
                                    yc <<= 1;
                                    yc >>= 1;
                                    int DeltaY = (int)(yc);
                                    m_CurrentX += (double)(DeltaX) * m_WidthScaleRatio;
                                    m_CurrentY += (double)(DeltaY) * m_HeightScaleRatio;
                                }
                            }
                        }
                        x = m_CurrentX;
                        y = m_CurrentY;
                        if (IsAMoveTo_Flag != 0)
                        {
                            return (uint)Path.EPathCommands.MoveTo;
                        }

                        return (uint)Path.EPathCommands.LineTo;

                    default:
                        throw new System.Exception("Unknown Status");
                }
            }

            return (uint)Path.EPathCommands.Stop;
        }
Exemple #51
0
        public override void OnMouseEnter(MouseEvent me)
        {
            //base.OnMouseEnter(me);

            isHover = true;
            if (menuBar.IsExpand)
            {
                menuBar.SetExpand(this);
                expand = true;
            }
            else
            {
                if (!expand)
                {
                    status = EStatus.Hover;
                }
            }
        }
Exemple #52
0
        public override void OnMouseRelease(MouseEvent me)
        {
            //base.OnMouseRelease(me);

            status = EStatus.Hover;
            if (expand)
            {
                menuBar.SetShrink();
                expand = false;
            }
            else
            {
                menuBar.SetExpand(this);
                expand = true;
            }
        }
Exemple #53
0
 public override void OnMouseEnter(MouseEvent me)
 {
     //base.OnMouseEnter(me);
     isHover = true;
     status = EStatus.Hover;
 }
Exemple #54
0
        public MenuItemButton(String text)
        {
            Text = text;
            this.textFont = new Text("MenuItemButton", UI.Instance.CurrentTheme.defaultTextFont, text);
            //this.textFont = textFont;
            //style = EStyle.Stretch;
            Left = 24;
            Top = 2;
            Bottom = 2;
            Right = 2;
            status = EStatus.Normal;

            Size = GetPreferedSize();
        }
Exemple #55
0
 public override void OnMouseExit(MouseEvent me)
 {
     //base.OnMouseExit(me);
     isHover = false;
     status = EStatus.Normal;
 }
Exemple #56
0
 /// <summary>
 /// Contraer el menú
 /// </summary>
 public void Shrink()
 {
     expand = false;
     status = EStatus.Normal;
 }
Exemple #57
0
        public override void OnMouseExit(AssortedWidgets.Events.MouseEvent me)
        {
            //base.OnMouseExit(me);

            isHover = false;
            status = EStatus.Normal;
        }
 private void Initial()
 {
     _markers.RemoveAll();
     _lastCommand = _source.Vertex(out _startX, out _startY);
     _status = EStatus.Accumulate;
 }
Exemple #59
0
        public MenuItemSubMenu(String text)
        {
            Text = text;
            this.textFont = new Text("MenuItemSubMenu", UI.Instance.CurrentTheme.defaultTextFont, text);
            //this.textFont = textFont;
            status = EStatus.Normal;
            expand = false;
            Left = 24;
            Top = 2;
            Bottom = 4;
            Right = 2;
            menuList = new MenuList();

            Size = GetPreferedSize();

            menuList.Position.X = 232 - 9;
            menuList.Position.Y = 0;
        }
Exemple #60
0
 internal NauseaStatus(EStatus a_type, float a_duration)
     : base(a_type, a_duration)
 {
 }