Example #1
0
        [Test] // ExSkip
        public void WorkWithNot()
        {
            var project = new Project(DataDir + "Project2.mpp");

            // gather all project tasks
            var coll = new ChildTasksCollector();

            TaskUtils.Apply(project.RootTask, coll, 0);

            // create a filter condition
            var filter = new NullCondition();

            // and reverse it by applying <see cref="Aspose.Tasks.Util.Not`1" /> condition
            var condition = new Not <Task>(filter);

            // apply the condition to the collected tasks
            List <Task> collection = Filter(coll.Tasks, condition);

            foreach (var task in collection)
            {
                Console.WriteLine("Name: " + task.Get(Tsk.Name));

                // work with other properties...
            }

            // ...
        }
Example #2
0
        public void Test___Method_Check___Value_not_null()
        {
            var testee = new NullCondition()
            {
                Value = new AnyVariable <int>()
                {
                    Value = 10
                }
            };

            Assert.IsFalse(testee.Check());
        }
Example #3
0
        public void Test___Method_Check___Value_null()
        {
            var testee = new NullCondition()
            {
                Value = new AnyVariable()
                {
                    Value = null
                }
            };

            Assert.IsTrue(testee.Check());
        }
        protected virtual string CompileNullCondition(SqlResult ctx, NullCondition item)
        {
            var op = item.IsNot ? "IS NOT NULL" : "IS NULL";

            return(Wrap(item.Column) + " " + op);
        }
Example #5
0
 protected override void initializeStepCondition() {
     stepCondition_ = new NullCondition<Vector>();
 }
Example #6
0
 protected void initializeStepConditionImpl()
 {
     stepCondition_ = new NullCondition<Vector>();
 }
Example #7
0
 public IsNullFilter(string name, NullCondition nullCondition)
 {
     this.Name           = name;
     this._nullCondition = nullCondition;
 }
 public BaseCondition(IQueryField Field, NullCondition Condition)
 {
     this.Field = Field;
     queryPart = string.Format("{0} is {1}null", Field.GetQueryPart(),
         Condition == NullCondition.IsNull ? "" : "not ");
 }
Example #9
0
        protected virtual string CompileNullCondition(SqlResult context, NullCondition item)
        {
            string op = item.IsNot ? "IS NOT NULL" : "IS NULL";

            return(wrapper.Wrap(item.Column) + " " + op);
        }