Ejemplo n.º 1
0
        public void Clear(ClearType Type)
        {
            ProfilerHelper_.Begin(ProfilerElementType.ClearTime);

            if ((Type & ClearType.Color) == ClearType.Color)
            {
                TaskDispatcher_.PushTask(0 % Context_.CoreNum, new ClearColorTask(Context_, 0, (byte)(Context_.ClearColor.B * 255)));
                TaskDispatcher_.PushTask(1 % Context_.CoreNum, new ClearColorTask(Context_, 1, (byte)(Context_.ClearColor.G * 255)));
                TaskDispatcher_.PushTask(2 % Context_.CoreNum, new ClearColorTask(Context_, 2, (byte)(Context_.ClearColor.R * 255)));
                TaskDispatcher_.PushTask(3 % Context_.CoreNum, new ClearColorTask(Context_, 3, (byte)(Context_.ClearColor.A * 255)));
            }

            if ((Type & ClearType.Depth) == ClearType.Depth)
            {
                TaskDispatcher_.PushTask(4 % Context_.CoreNum, new ClearDepthTask(Context_));
            }

            /*if ((Type & ClearType.Stencil) == ClearType.Stencil)
             * {
             * }*/

            TaskDispatcher_.Wait();
            Context_.FrameCount++;

            ProfilerHelper_.End(ProfilerElementType.ClearTime);
        }
Ejemplo n.º 2
0
    void FromIntToClearType(int _type)
    {
        switch (_type)
        {
        case 0:
            clearType = ClearType.Defalut;
            break;

        case 1:
            clearType = ClearType.Delivery;
            break;

        case 2:
            clearType = ClearType.Level;
            break;

        case 3:
            clearType = ClearType.Rank;
            break;

        default:
            clearType = ClearType.Defalut;
            break;
        }
    }
Ejemplo n.º 3
0
    public int LockMino(out ClearType ct)
    {
        int line = 0;

        if (!field.IsValid(activeMino))
        {
            GameOver();
        }
        field.LockMino(activeMino);//将当前块并入地形
        if (field.LinesCanClear(activeMino) > 0)
        {
            combo += 1;
            CheckClearType();
            line      = field.Clear(activeMino);
            statLine += line;
        }
        else
        {
            combo = 0;
        }
        isHeld = false;
        statPiece++;
        //bool isWallKick = IsWallKick(operation);
        AfterLock();
        ct        = clearType;
        operation = "";
        return(line);
    }
Ejemplo n.º 4
0
        internal static void InternalClearArea(ClearType type, Vector3 position, float radius)
        {
            switch (type)
            {
            case ClearType.All:
                Function.Call("CLEAR_AREA", new Parameter[] {
                    position.X, position.Y, position.Z, radius, true
                });
                return;

            case ClearType.Chars:
                Function.Call("CLEAR_AREA_OF_CHARS", new Parameter[] {
                    position.X, position.Y, position.Z, radius
                });
                return;

            case ClearType.Cars:
                Function.Call("CLEAR_AREA_OF_CARS", new Parameter[] {
                    position.X, position.Y, position.Z, radius
                });
                return;

            case ClearType.Cops:
                Function.Call("CLEAR_AREA_OF_COPS", new Parameter[] {
                    position.X, position.Y, position.Z, radius
                });
                return;

            case ClearType.Objects:
                Function.Call("CLEAR_AREA_OF_OBJECTS", new Parameter[] {
                    position.X, position.Y, position.Z, radius
                });
                return;
            }
        }
Ejemplo n.º 5
0
        public static void ClearSpaceUsage(ClearType type)
        {
            var storage = GetStorage();

            if (storage == null)
            {
                throw new Exception("storage not found");
            }

            var hash = GetUserMd5Hash(SecurityContext.CurrentAccount.ID);

            switch (type)
            {
            case ClearType.All:
                storage.DeleteDirectory(string.Empty, hash);
                break;

            case ClearType.Month:
                storage.DeleteFiles(string.Empty, hash, DateTime.MinValue, DateTime.Now.AddMonths(-1));
                break;

            case ClearType.Year:
                storage.DeleteFiles(string.Empty, hash, DateTime.MinValue, DateTime.Now.AddYears(-1));
                break;
            }
        }
Ejemplo n.º 6
0
 public override bool Update()
 {
     if (IsDirty)
     {
         int    index     = 0;
         string selection = EvaluateChoice(ref index);
         if (StringUtils.EqualsIgnoreCase(selection, "color"))
         {
             ClearOption = ClearType.Color;
         }
         else if (StringUtils.EqualsIgnoreCase(selection, "depth"))
         {
             ClearOption = ClearType.Depth;
         }
         else if (StringUtils.EqualsIgnoreCase(selection, "stencil"))
         {
             ClearOption = ClearType.Stencil;
         }
         else
         {
             Log.Error("SAS: unrecognized clear command");
         }
         IsDirty = false;
     }
     return(true);
 }
Ejemplo n.º 7
0
        }         // ICommandHandler.Start

        // ----------------------------------------------------------------------
        private void Clear(ClearType clearType)
        {
            switch (clearType)
            {
            case ClearType.TimeRange:
                WorkingTimePeriod = TimePeriodMode.Year;
                break;

            case ClearType.Filter:
                yearFilter.SetSelection(false);
                yearMonthFilter.SetSelection(false);
                dayFilter.SetSelection(false);
                dayOfWeekFilter.SetSelection(false);
                break;

            case ClearType.CollectingRange:
                CollectMonthStart = null;
                CollectMonthEnd   = null;
                CollectDayStart   = null;
                CollectDayEnd     = null;
                CollectHourStart  = null;
                CollectHourEnd    = null;
                break;
            }
        }         // Clear
Ejemplo n.º 8
0
        public static void RankingManage(ref ScoreStruct scoreData, int score, ClearType clear)
        {
            if (scoreData.scoreRanking == null)
            {
                scoreData.scoreRanking    = new RankingStruct[1];
                scoreData.scoreRanking[0] = new RankingStruct(StaticValue.playerName, score, clear);

                return;
            }

            int rankingCount = scoreData.scoreRanking.Length;

            if (rankingCount < Constant.rankingLength)
            {
                Array.Resize(ref scoreData.scoreRanking, rankingCount + 1);

                RankingStruct rankingData = new RankingStruct(StaticValue.playerName, score, clear);
                scoreData.scoreRanking[rankingCount] = rankingData;
            }
            else if (scoreData.scoreRanking[rankingCount - 1].score < score)
            {
                RankingStruct rankingData = new RankingStruct(StaticValue.playerName, score, clear);
                scoreData.scoreRanking[rankingCount - 1] = rankingData;
            }

            Array.Sort(scoreData.scoreRanking, (x, y) => y.score - x.score);
        }
Ejemplo n.º 9
0
 public void SetContent(int rank, string name, int score, ClearType clearType, ClearTypeData clearTypeData)
 {
     rankText.text = rank.ToString();
     nameText.SetText(name);
     scoreText.text = score.ToString("D7");
     clearText.text = clearTypeData.clearTypes[(int)clearType].clearName;
     clearText.colorGradientPreset = clearTypeData.clearTypes[(int)clearType].colorGradient;
 }
Ejemplo n.º 10
0
 public QuestData()
 {
     id        = 0;
     length    = 0;
     name      = null;
     content   = null;
     openType  = OpenType.Defalut;
     clearType = ClearType.Defalut;
 }
Ejemplo n.º 11
0
        public static void ClearArea(ClearType type, Vector3 position, float radius)
        {
            if (position == null)
            {
                throw new ArgumentNullException(nameof(position));
            }

            Functions.InternalClearArea(type, position, radius);
        }
Ejemplo n.º 12
0
    public void ClearVideos(ClearType type)
    {
        for (int i = 0; i < unitList.Count; ++i)
        {
            unitList[i].transform.SetParent(helpPanel.transform, true);
            unitList[i].Clear(type);
        }

        unitList.Clear();
    }
Ejemplo n.º 13
0
    public static ClearType CheckClearType(Field field, Mino mino, string op, int combo, bool wasB2B)
    {
        ClearType clearType;
        Field     fClone = field.Clone();

        fClone.LockMino(mino);

        int minoId = mino.GetIdInt();
        int lines  = fClone.LinesCanClear(mino);

        bool tSpin     = false;
        int  tSpinType = 0;//0mini 1single 2double 3triple
        bool spin      = IsWallKick(op);
        bool pc        = fClone.IsAllClear(lines);

        //bool wasB2b;
        //int combo;


        if (mino.id == Mino.MinoID.T)//tspin判定
        {
            bool c, f;
            c = field.HasThreeCorners(mino);
            f = field.HasTwoFeets(mino);
            if (lines == 1)
            {
                //Debug.Log(cannotGoUp);
                if (c && f)//t-spin single
                {
                    tSpin     = true;
                    tSpinType = 1;
                }
                else if (c && !f && spin)//t-spin mini
                {
                    tSpin     = true;
                    tSpinType = 0;
                }
            }
            else if (lines == 2 && (c || spin))//t-spin double
            {
                tSpin     = true;
                tSpinType = 2;
            }
            else if (lines == 3)
            {
                tSpin     = true;
                tSpinType = 3;
            }
        }
        clearType = new ClearType(minoId, lines, tSpin, tSpinType, pc, combo, wasB2B);

        return(clearType);
    }
Ejemplo n.º 14
0
        /// <summary>
        /// 获取PurgeTool信息
        /// </summary>
        /// <param name="clearType"></param>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="SortField"></param>
        /// <param name="callback"></param>
        public void GetPurgeToolByQuery(ClearType clearType, int PageSize, int PageIndex, string SortField, EventHandler <RestClientEventArgs <dynamic> > callback)
        {
            PurgeToolQueryFilter query = new PurgeToolQueryFilter()
            {
                PageInfo = new QueryFilter.Common.PagingInfo()
                {
                    PageIndex = PageIndex, PageSize = PageSize, SortBy = SortField
                },
                ClearType = clearType
            };

            restClient.QueryDynamicData(GetPurgeToolByQueryUrl, query, callback);
        }
Ejemplo n.º 15
0
        void Mode_Changed(object sender, SelectionChangedEventArgs e)
        {
            ClearType selected = (ClearType)ClearMode.SelectedIndex;

            if (_clear.Mode != selected)
            {
                Program.Project.Undo.AddAndExecute(new Clear.ModeUndoEntry(
                                                       _clear,
                                                       _clear.Mode,
                                                       selected
                                                       ));
            }
        }
Ejemplo n.º 16
0
    private void CheckClearType()
    {
        int minoId = activeMino.GetIdInt();
        int lines  = field.LinesCanClear(activeMino);

        bool tSpin     = false;
        bool spin      = IsWallKick(operation);
        int  tSpinType = 0;//0mini 1single 2double 3triple
        bool pc        = field.IsAllClear(lines);

        //bool wasB2b;
        //int combo;


        if (activeMino.id == Mino.MinoID.T)//tspin判定
        {
            bool c, f;
            c = field.HasThreeCorners(activeMino);
            f = field.HasTwoFeets(activeMino);
            if (lines == 1)
            {
                //Debug.Log(cannotGoUp);
                if (c && f)//t-spin single
                {
                    tSpin     = true;
                    tSpinType = 1;
                }
                else if (c && !f && spin)//t-spin mini
                {
                    tSpin     = true;
                    tSpinType = 0;
                }
            }
            else if (lines == 2 && (c || spin))//t-spin double
            {
                tSpin     = true;
                tSpinType = 2;
            }
            else if (lines == 3)
            {
                tSpin     = true;
                tSpinType = 3;
            }
        }
        clearType = new ClearType(minoId, lines, tSpin, tSpinType, pc, combo, wasB2B);

        wasB2B      = clearType.GetIsB2b();
        statAttack += clearType.GetAttack();
    }
    private IEnumerator ShowResult()
    {
        StaticValue.trackCount++;

        yield return(Find.GetSceneLoadManager().LoadResultScene());

        yield return(null);

        resultController = GameObject.FindWithTag("ResultController").GetComponent <ResultController>();

        ResultData resultData = new ResultData();

        ClearType  clearType  = JudgeClearType();
        Difficulty selectDif  = StaticValue.difficulty;
        string     musicTitle = musicStruct.musicName;
        int        score      = uiCountroller.targetScore;
        int        bestScore  = ChartUtility.GetBestScore(StaticValue.loadName, selectDif);

        resultData.musicTitle = musicTitle;
        resultData.clearType  = clearType;
        resultData.composer   = musicStruct.composer;
        resultData.difficulty = selectDif;
        resultData.score      = uiCountroller.targetScore;
        resultData.bestScore  = bestScore;
        resultData.judgeCount = uiData.judgeCount;
        resultData.level      = GetPlayingChart().level;
        resultData.maxCombo   = uiData.maxConbo;
        resultData.fastCount  = inputController.fastCount;
        resultData.lateCount  = inputController.lateCount;

        resultController.SetUIValue(resultData);
        yield return(new WaitForSeconds(0.5f));

        resultController.PlayResultAnim(true);

        float loadTime = 2.5f;

        if (!StaticValue.isAuto)
        {
            float nowTime = Time.realtimeSinceStartup;
            yield return(StartCoroutine(ChartUtility.WriteScoreDataFromResult(StaticValue.loadName, score, selectDif, clearType)));

            loadTime = Mathf.Clamp(loadTime - Time.realtimeSinceStartup - nowTime, 0, 2.5f);
        }

        yield return(new WaitForSeconds(loadTime));

        isResult = true;
    }
Ejemplo n.º 18
0
        public override Resources GetById(int id)
        {
            string    str = string.Format("select * from ClearType where Id=" + id);
            DataTable dt  = helper.GetData(str);

            if (dt != null && dt.Rows.Count > 0)
            {
                DataRow   row      = dt.Rows[0];
                ClearType cleaType = new ClearType();
                cleaType.Id   = int.Parse(row[0].ToString());
                cleaType.Name = row[1].ToString();
                return(cleaType);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 19
0
        void Mode_Changed(object sender, SelectionChangedEventArgs e)
        {
            ClearType selected = (ClearType)ClearMode.SelectedIndex;

            if (_clear.Mode != selected)
            {
                ClearType  u    = _clear.Mode;
                ClearType  r    = selected;
                List <int> path = Track.GetPath(_clear);

                Program.Project.Undo.Add($"Clear Orientation Changed to {((ComboBoxItem)ClearMode.ItemContainerGenerator.ContainerFromIndex((int)r)).Content}", () => {
                    ((Clear)Track.TraversePath(path)).Mode = u;
                }, () => {
                    ((Clear)Track.TraversePath(path)).Mode = r;
                });

                _clear.Mode = selected;
            }
        }
Ejemplo n.º 20
0
        //private  List<Render2Texture*> RTTs;
        //private  RenderQueue* m_RenderQueue;

        public Camera(Vector3 position, Vector3 target, float fov, Vector3 up, float zNear, float zFar, float aspect)
        {
            for (int i = 0; i < mPlans.Count; i++)
            {
                mPlans[i] = new float[4];
            }
            isPerspective      = true;
            mMatrixProjection  = Matrix4x4.CreatePerspective(fov, aspect, zNear, zFar);
            mMatrixView        = Matrix4x4.CreateLookAt(Transform.Position, target, up);
            Transform.Rotation = Quaternion.Fromat(mMatrixView);
            Transform.Position = position;
            mNear = zNear;
            mFar  = zFar;
            mFov  = fov;
            mMatrixViewInverse    = mMatrixView.Inverse();
            mMatrixProjectInverse = mMatrixProjection.Inverse();
            mType      = ObjectType.eT_Camera;
            mClearType = (ClearType.eCT_Color | ClearType.eCT_Depth | ClearType.eCT_Stencil);
            mDepth     = 0;
        }
Ejemplo n.º 21
0
    public static void AddClearPoint(ClearType clearType)
    {
        List <Mission> currentMissions = userMissions.FindAll(x => !x.enable && !x.clear && x.clearType == (int)clearType);

        for (var i = 0; i < currentMissions.Count; i++)
        {
            //업적
            if (currentMissions[i].missionType == 2)
            {
                currentMissions[i].point += 1;
            }
            //임무
            else
            {
                if (currentMissions[i].point < currentMissions[i].clearPoint)
                {
                    currentMissions[i].point += 1;
                }
            }
        }
    }
Ejemplo n.º 22
0
        /// <summary>
        /// Removes some subset of the state.
        /// </summary>
        /// <param name="type">The type of data to remove.</param>
        public void Clear(ClearType type)
        {
            switch (type)
            {
            case ClearType.All:
                ClearAll();
                break;

            case ClearType.Dialog:
                ClearDialog();
                break;

            case ClearType.Choices:
                ClearChoices();
                break;

            default:
                throw new InvalidOperationException(
                          "Unknown clear type! Please file a bug report."
                          );
            }
        }
Ejemplo n.º 23
0
    public void AfterLock(ClearType ct)
    {
        UpdateGoalText();
        if (gameMode == 1)//40L
        {
            if (game.statLine >= 40)
            {
                game.GameClear();
                GameClear(gameTime.ToString("0.00"), false);
            }
        }
        else if (gameMode == 4)//cheese 100L
        {
            if (cheeseDigged >= cheeseGoal)
            {
                game.GameClear();

                GameClear("# " + game.statPiece.ToString(), false);
            }

            cheeseDigged += game.field.dig;
            UpdateGoalText();
            if (game.combo <= 0)
            {
                game.field.RaiseCheeseGarbage(cheeseGoal - cheeseDigged >= cheeseMaxY?cheeseMaxY: cheeseGoal - cheeseDigged);
                UpdateFieldDisplay();
            }
            else
            {
                game.field.RaiseCheeseGarbage(cheeseGoal - cheeseDigged >= cheeseMinY ? cheeseMinY : cheeseGoal - cheeseDigged);
                UpdateFieldDisplay();
            }
        }

        aiHintTimer     = 0f;
        IsAIHintUpdated = false;
        ClearAIHint();
        //UpdateAIHint();
    }
Ejemplo n.º 24
0
        public override void ClearColor(float r, float g, float b, float a, ClearType clearType)
        {
            uint _type       = 0;
            uint _iclearType = (uint)clearType;

            if ((_iclearType & (uint)ClearType.eCT_Color) != 0)
            {
                gl2.ClearColor(r, g, b, a);
                _type |= gl2.GL_COLOR_BUFFER_BIT;
            }
            if ((_iclearType & (uint)ClearType.eCT_Depth) != 0)
            {
                gl2.ClearDepth(1);
                _type |= gl2.GL_DEPTH_BUFFER_BIT;
            }
            if ((_iclearType & (uint)ClearType.eCT_Stencil) != 0)
            {
                gl2.ClearStencil(0);
                _type |= gl2.GL_STENCIL_BUFFER_BIT;
            }
            gl2.Clear(_type);
        }
Ejemplo n.º 25
0
    void ClearTerms(ClearType _type, string _terms)
    {
        switch (_type)
        {
        case ClearType.Defalut:
            clearTerms = null;
            break;

        case ClearType.Delivery:
            StringSplit(ref clearTerms, _terms);
            break;

        case ClearType.Level:
            openTerms    = new int[1];
            openTerms[0] = int.Parse(_terms);
            break;

        case ClearType.Rank:
            openTerms    = new int[1];
            openTerms[0] = int.Parse(_terms);
            break;
        }
    }
Ejemplo n.º 26
0
        protected void Clear(ClearType type)
        {
            int start = 0, end = 0;

            switch (type)
            {
            case ClearType.AboveDialog:
                start = 2;
                end   = Data._generalInfo.dividerLine;
                break;

            case ClearType.Dialog:
                start = Data._generalInfo.dividerLine + 1;
                end   = Console.BufferHeight;
                break;

            case ClearType.Both:
                start = 2;
                end   = Console.BufferHeight;
                break;
            }

            Clear(start, end);
        }
Ejemplo n.º 27
0
        /// <summary>
        /// スコアデータを更新する
        /// </summary>
        /// <param name="musicName"></param>
        /// <param name="score"></param>
        /// <param name="difficulty"></param>
        /// <param name="clearType"></param>
        /// <returns></returns>
        public static IEnumerator WriteScoreDataFromResult(string musicName, int score, Difficulty difficulty, ClearType clearType)
        {
            int             chartElement = (int)difficulty;
            ScoreDataStruct scoreData    = null;

            if (Constant.CompareEnv(GameEnvironment.local))
            {
                scoreData = LoadScoreData(musicName);
            }
            else if (Constant.CompareEnv(GameEnvironment.webGL))
            {
                bool isFinish = false;
                NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject>("MusicData");
                query.WhereEqualTo("musicName", musicName);
                query.Limit = 1;
                query.FindAsync((List <NCMBObject> objList, NCMBException e) =>
                {
                    if (e != null)
                    {
                        isFinish = true;
                        Debug.LogError(e);
                    }
                    else
                    {
                        string scoreJson = Convert.ToString(objList[0]["scoreData"]);
                        scoreData        = JsonUtility.FromJson <ScoreDataStruct>(scoreJson);
                        isFinish         = true;
                    }
                });
                // 取得が完了するまで待機
                while (!isFinish)
                {
                    yield return(null);
                }
            }

            if (scoreData == null)
            {
                yield break;
            }

            ScoreStruct scoreStruct = scoreData.scores[chartElement];

            if (scoreData == null)
            {
                scoreData = new ScoreDataStruct();
            }

            if (scoreStruct.bestScore < score)
            {
                scoreData.scores[chartElement].bestScore = score;
            }
            if (scoreStruct.clearType < clearType)
            {
                scoreData.scores[chartElement].clearType = clearType;
            }
            if (clearType > ClearType.Failed)
            {
                scoreData.scores[chartElement].clearCount++;
            }

            scoreData.scores[chartElement].playCount++;
            RankingManage(ref scoreData.scores[chartElement], score, clearType);

            string scoreDataJson = JsonUtility.ToJson(scoreData);

            if (Constant.CompareEnv(GameEnvironment.local))
            {
                string filePath = Application.streamingAssetsPath + Constant.musicDataDirectory + "/" + musicName;

                if (!Directory.Exists(filePath))
                {
                    yield break;
                }

                string dataFilePath = filePath + "/" + musicName + Constant.scoreExtension;

                File.WriteAllText(dataFilePath, scoreDataJson);
            }
            else if (Constant.CompareEnv(GameEnvironment.webGL))
            {
                bool isFinish = false;
                NCMBQuery <NCMBObject> query = new NCMBQuery <NCMBObject>("MusicData");
                query.WhereEqualTo("musicName", musicName);
                query.Limit = 1;
                query.FindAsync((List <NCMBObject> objList, NCMBException e) =>
                {
                    if (e != null)
                    {
                        isFinish = true;
                        Debug.LogError(e);
                    }
                    else
                    {
                        objList[0]["scoreData"] = scoreDataJson;
                        objList[0].SaveAsync((NCMBException exp) =>
                        {
                            if (exp != null)
                            {
                                isFinish = true;
                                Debug.LogError(e);
                            }
                            else
                            {
                                isFinish = true;
                            }
                        });
                    }
                });
                // 取得が完了するまで待機
                while (!isFinish)
                {
                    yield return(null);
                }
                SetScoreCacheStruct(musicName, scoreData);
            }
        }
Ejemplo n.º 28
0
 public void SetMode(ClearType mode) => ClearMode.SelectedIndex = (int)mode;
 public void setColor(ref TextMeshProUGUI text, ClearType clearType)
 {
     text.color = clearTypes[(int)clearType].clearColor;
     text.colorGradientPreset = clearTypes[(int)clearType].colorGradient;
 }
Ejemplo n.º 30
0
        private static IWebDriver ClickClearContextMenu(this IWebDriver webDriver, int index, ClearType clearType) {
            var tab = webDriver.FindElements(By.CssSelector(".nof-tab"))[index];
            var loc = (ILocatable)tab;
            var mouse = ((IHasInputDevices)webDriver).Mouse;
            mouse.ContextClick(loc.Coordinates);
            webDriver.WaitForAjaxComplete();

            tab.FindElements(By.CssSelector("li a"))[(int)clearType].Click();
            webDriver.WaitForAjaxComplete();

            var firstTabImg = webDriver.FindElements(By.CssSelector(".nof-tab img")).FirstOrDefault();

            if (firstTabImg != null) {
                firstTabImg.Click();
            }

            return webDriver;
        }
Ejemplo n.º 31
0
        private static void ClickClearContextMenu(this SafeWebDriverWait wait, int index, ClearType clearType) {
            var tabCount = wait.Driver.FindElements(By.CssSelector(".nof-tab")).Count;
            var newCount = clearType == ClearType.ClearThis ? tabCount - 1 : clearType == ClearType.ClearOthers ? 1 : 0;

            var webDriver = wait.Driver;
            var tab = webDriver.FindElements(By.CssSelector(".nof-tab"))[index];
            var loc = (ILocatable) tab;
            var mouse = ((IHasInputDevices) webDriver).Mouse;
            mouse.ContextClick(loc.Coordinates);

            var selector = string.Format(".ui-menu-item:nth-of-type({0}) a", (int)clearType);
            wait.Until(wd => wd.FindElement(By.CssSelector(selector)));
            wait.ClickAndWait(selector, wd => wd.FindElements(By.CssSelector(".nof-tab")).Count == newCount);
        }
Ejemplo n.º 32
0
        private static IWebDriver ClickClearContextMenu(this IWebDriver webDriver, int index, ClearType clearType)
        {
            var tab   = webDriver.FindElements(By.CssSelector(".nof-tab"))[index];
            var loc   = (ILocatable)tab;
            var mouse = ((IHasInputDevices)webDriver).Mouse;

            mouse.ContextClick(loc.Coordinates);
            webDriver.WaitForAjaxComplete();

            tab.FindElements(By.CssSelector("li a"))[(int)clearType].Click();
            webDriver.WaitForAjaxComplete();

            var firstTabImg = webDriver.FindElements(By.CssSelector(".nof-tab img")).FirstOrDefault();

            if (firstTabImg != null)
            {
                firstTabImg.Click();
            }

            return(webDriver);
        }
Ejemplo n.º 33
0
 // ----------------------------------------------------------------------
 private void Clear( ClearType clearType )
 {
     switch ( clearType )
     {
         case ClearType.TimeRange:
             WorkingTimePeriod = TimePeriodMode.Year;
             break;
         case ClearType.Filter:
             yearFilter.SetSelection( false );
             yearMonthFilter.SetSelection( false );
             dayFilter.SetSelection( false );
             dayOfWeekFilter.SetSelection( false );
             break;
         case ClearType.CollectingRange:
             CollectMonthStart = null;
             CollectMonthEnd = null;
             CollectDayStart = null;
             CollectDayEnd = null;
             CollectHourStart = null;
             CollectHourEnd = null;
             break;
     }
 }