Inheritance: MonoBehaviour
 public Filter(bool exclude, FieldIndex fieldIndex, TimeLength value, FilterTest test)
 {
     Exclude_ = exclude;
     FieldIndex_ = fieldIndex;
     Value_ = value.TotalMinutes;
     Test_ = test;
 }
 public Filter(bool exclude, FieldIndex fieldIndex, TimeOfDay value, FilterTest test)
 {
     Exclude_ = exclude;
     FieldIndex_ = fieldIndex;
     Value_ = value.DayMinutes;
     Test_ = test;
 }
 public Filter(Filter other)
 {
     this.Exclude_ = other.Exclude_;
     this.FieldIndex_ = other.FieldIndex_;
     this.Value_ = other.Value_;
     this.Test_ = other.Test_;
 }
Exemple #4
0
 public Filter(bool exclude, FieldIndex fieldIndex, int value, FilterTest test)
 {
     Exclude_    = exclude;
     FieldIndex_ = fieldIndex;
     Value_      = value;
     Test_       = test;
 }
Exemple #5
0
        public void CheckSetFilter()
        {
            var camera     = GetCamera();
            var testFilter = new FilterTest();

            camera.SetFilter(testFilter);
        }
Exemple #6
0
 public Filter(bool exclude, FieldIndex fieldIndex, TimeLength value, FilterTest test)
 {
     Exclude_    = exclude;
     FieldIndex_ = fieldIndex;
     Value_      = value.TotalMinutes;
     Test_       = test;
 }
 public Filter(bool exclude, FieldIndex fieldIndex, TimeLength value, FilterTest test)
 {
     Exclude    = exclude;
     FieldIndex = fieldIndex;
     ValueAsInt = value.TotalMinutes;
     Test       = test;
 }
Exemple #8
0
 public Filter(Filter other)
 {
     this.Exclude_    = other.Exclude_;
     this.FieldIndex_ = other.FieldIndex_;
     this.Value_      = other.Value_;
     this.Test_       = other.Test_;
 }
 public Filter(bool exclude, FieldIndex fieldIndex, TimeOfDay value, FilterTest test)
 {
     Exclude    = exclude;
     FieldIndex = fieldIndex;
     ValueAsInt = value.DayMinutes;
     Test       = test;
 }
 public Filter(bool exclude, FieldIndex fieldIndex, int value, FilterTest test)
 {
     Exclude    = exclude;
     FieldIndex = fieldIndex;
     ValueAsInt = value;
     Test       = test;
 }
Exemple #11
0
 public Filter(bool exclude, FieldIndex fieldIndex, TimeOfDay value, FilterTest test)
 {
     Exclude_    = exclude;
     FieldIndex_ = fieldIndex;
     Value_      = value.DayMinutes;
     Test_       = test;
 }
Exemple #12
0
        public static void Main()
        {
            FilterTest students = new FilterTest();

            students.RunTests();
            Console.ReadKey();
        }
Exemple #13
0
 public Filter()
 {
     // defaults
     Exclude_    = true;
     FieldIndex_ = Solver.FieldIndex.Days;
     Test_       = FilterTest.GreaterThan;
     Value_      = 5;
 }
 public static string FieldSpecificTest(FieldType field, FilterTest test)
 {
     if (field == FieldType.Unknown)
     {
         return("");
     }
     return(fieldTest[(int)field][(int)test]);
 }
Exemple #15
0
 public Filter()
 {
     // defaults
     Exclude_ = true;
     FieldIndex_ = Solver.FieldIndex.Days;
     Test_ = FilterTest.GreaterThan;
     Value_ = 5;
 }
        public async Task <PagedData <Test> > GetTestsAsync(FilterTest filter)
        {
            var user = await Context.GetCurrentUserAsync();

            if (user.IsAdmin())
            {
                var specification =
                    new TestsByName(filter.Name) &
                    new TestsByDisciplineId(filter.DisciplineId) &
                    new TestsByType(filter.TestType);

                if (filter.OnlyActive)
                {
                    specification = specification & new TestsByActive(true);
                }

                var(count, tests) = await _repositoryTest.FindPaginatedAsync(specification, filter);

                return(new PagedData <Test>(Mapper.Map <List <Test> >(tests), count));
            }

            if (user.IsLecturer())
            {
                var specification =
                    new TestsByName(filter.Name) &
                    new TestsByDisciplineId(filter.DisciplineId) &
                    new TestsByType(filter.TestType) &
                    new TestsByLecturerId(user.Id);

                if (filter.OnlyActive)
                {
                    specification = specification & new TestsByActive(true);
                }

                var(count, tests) = await _repositoryTest.FindPaginatedAsync(specification, filter);

                return(new PagedData <Test>(Mapper.Map <List <Test> >(tests), count));
            }

            if (user.IsStudent())
            {
                var specification =
                    new TestsByName(filter.Name) &
                    new TestsByDisciplineId(filter.DisciplineId) &
                    new TestsByType(filter.TestType) &
                    new TestsByStudentId(user.Id) &
                    new TestsForStudents();

                var(count, tests) = await _repositoryTest.FindPaginatedAsync(specification, filter);

                return(new PagedData <Test>(Mapper.Map <List <Test> >(tests), count));
            }

            throw ExceptionHelper.NoAccess();
        }
Exemple #17
0
        /// <summary>
        /// starts the filter test
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdFilter_Click(object sender, EventArgs e)
        {
            Bitmap _refbmp = getReferenceScreenshot();

            if (_refbmp == null)
            {
                return;
            }

            FilterTest FTest = new FilterTest();

            FTest.CutoffLevel = Program.DBCon.getIniValue <Int32>(IBE.IBESettingsView.DB_GROUPNAME, "GUIColorCutoffLevel");
            FTest.TestBitmap  = _refbmp;

            FTest.ShowDialog(this);

            if (FTest.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                txtGUIColorCutoffLevel.Text = FTest.CutoffLevel.ToString();
                Program.DBCon.setIniValue(IBE.IBESettingsView.DB_GROUPNAME, "GUIColorCutoffLevel", FTest.CutoffLevel.ToString());
            }
        }
Exemple #18
0
 public Filter(bool exclude, FieldIndex fieldIndex, int value, FilterTest test)
 {
     Exclude_ = exclude;
     FieldIndex_ = fieldIndex;
     Value_ = value;
     Test_ = test;
 }
 public FilterPropertyAttribute(FilterTest test)
 {
     Test = test;
 }
Exemple #20
0
 public async Task <IActionResult> GetDisciplineTests([FromRoute] int id, [FromQuery] FilterTest filter)
 {
     return(await Ok(() => _serviceTest.GetTestsAsync(filter.SetDisciplineId(id))));
 }
Exemple #21
0
        /// <summary>
        /// starts the filter test
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdFilter_Click(object sender, EventArgs e)
        {
            Bitmap _refbmp = getReferenceScreenshot();

            if (_refbmp == null)
            {
                return;
            }

            FilterTest FTest = new FilterTest();

            FTest.CutoffLevel = Program.DBCon.getIniValue<Int32>(IBE.MTSettings.tabSettings.DB_GROUPNAME, "GUIColorCutoffLevel");
            FTest.TestBitmap = _refbmp;

            FTest.ShowDialog(this);

            if (FTest.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                txtGUIColorCutoffLevel.Text = FTest.CutoffLevel.ToString();
                Program.DBCon.setIniValue(IBE.MTSettings.tabSettings.DB_GROUPNAME, "GUIColorCutoffLevel", FTest.CutoffLevel.ToString());
            }
        }
Exemple #22
0
 public DiagnosticsEntry(FilterTest test, bool passed, string details)
 {
     Test    = test;
     Passed  = passed;
     Details = details;
 }
Exemple #23
0
        /// <summary>
        /// starts the filter test
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cmdFilter_Click(object sender, EventArgs e)
        {

            Bitmap _refbmp = getReferenceScreenshot();

            if (_refbmp == null)
            {
                return;
            }

            FilterTest FTest = new FilterTest();

            FTest.CutoffLevel = RegulatedNoiseSettings.GUIColorCutoffLevel;
            FTest.TestBitmap = _refbmp;

            FTest.ShowDialog(this);

            if (FTest.DialogResult == System.Windows.Forms.DialogResult.OK)
            { 
                txtGUIColorCutoffLevel.Text = FTest.CutoffLevel.ToString();
                RegulatedNoiseSettings.GUIColorCutoffLevel = FTest.CutoffLevel;
                SaveSettings();            
            }
        }
Exemple #24
0
 public SimpleTester(FilterTest callback)
 {
     _callback = callback;
 }
Exemple #25
0
 public FilterFactory([NotNull] FilterTest testCallback, [CanBeNull] FilterParams filterParams)
 {
     _tester       = new SimpleTester(testCallback);
     _filterParams = filterParams;
 }
Exemple #26
0
        /// <summary>
        /// SqlSugar的功能介绍
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] args)
        {
            // 设置执行的DEMO
            var    switchOn = "ignoreerrorcolumns";
            IDemos demo     = null;

            switch (switchOn)
            {
                #region 基本功能

            // 查询
            case "select":
                demo = new SelectTest();
                break;

            // 删除
            case "delete":
                demo = new DeleteTest();
                break;

            // 插入
            case "insert":
                demo = new InsertTest();
                break;

            // 更新
            case "update":
                demo = new UpdateTest();
                break;

            // 基层函数的用法
            case "ado":
                demo = new AdoTest();
                break;

            // 事务
            case "tran":
                demo = new TranTest();
                break;

            // 创建实体函数
            case "createclass":
                demo = new CreateClassTest();
                break;

            // 日志记录
            case "log":
                demo = new LogTest();
                break;

            // 枚举支持
            case "enum":
                demo = new EnumDemoTest();
                break;

                #endregion

                #region 实体映射

            // 自动排除非数据库列
            case "ignoreerrorcolumns":
                demo = new IgnoreErrorColumnsTest();
                break;

            // 别名表
            case "mappingtable":
                demo = new MappingTableTest();
                break;

            // 别名列
            case "mappingcolumns":
                demo = new MappingColumnsTest();
                break;

            // 通过属性的方法设置别名表和别名字段
            case "attributesmapping":
                demo = new AttributesMappingTest();
                break;

                #endregion

                #region 业务应用

            // 过滤器
            case "filter":
                demo = new FilterTest();
                break;

            // 过滤器2
            case "filter2":
                demo = new Filter2Test();
                break;

            // 流水号功能
            case "serialnumber":
                demo = new SerialNumberTest();
                break;

            // 多语言支持 http://www.cnblogs.com/sunkaixuan/p/5709583.html
            // 多库并行计算 http://www.cnblogs.com/sunkaixuan/p/5046517.html
            // 配置与实例的用法
            case "initconfig":
                demo = new InitConfigTest();
                break;

                #endregion

                #region 支持

            // 公开函数数
            case "pubmethod":
                demo = new PubMethodTest();
                break;

            // Sql2012分页的支持
            case "sqlpagemodel":
                demo = new SqlPageModelTest();
                break;

            // 设置ToJson的日期格式
            case "serializerdateformat":
                demo = new SerializerDateFormatTest();
                break;

                #endregion

                #region 测试用例

            case "test":
                demo = new UnitTest();
                break;

            default:
                Console.WriteLine("switchOn的值错误,请输入正确的 case");
                break;

                #endregion
            }

            if (demo == null)
            {
                return;
            }

            // 执行DEMO
            demo.Init();

            Console.WriteLine("执行成功请关闭窗口");
            Console.ReadKey();
        }
 public FilterPropertyAttribute(string propertyName, FilterTest test = FilterTest.Equal)
 {
     PropertyName = propertyName;
     Test         = test;
 }
 public async Task <IActionResult> GetTests([FromQuery] FilterTest filter)
 {
     return(await Ok(() => _serviceTest.GetTestsAsync(filter)));
 }
Exemple #29
0
 private void acceptedButton_Click(object sender, EventArgs e)
 {
     FilterTest.RunTest();
 }
Exemple #30
0
 public static string FieldSpecificTest(FieldType field, FilterTest test)
 {
     if (field == FieldType.Unknown)
         return "";
     return fieldTest[(int)field][(int)test];
 }