System.Windows.Automation.OrCondition.GetConditions C# (CSharp) Method

GetConditions() public method

public GetConditions ( ) : Condition[]
return Condition[]
        public Condition[] GetConditions()
        {
            return ConditionArrayNativeToManaged(this._obj.GetChildren());
        }
    }

Usage Example

示例#1
0
        public void ContentViewConditionTest()
        {
            SWA.Condition contentViewCond = SWA.Automation.ContentViewCondition;
            Assert.IsNotNull(contentViewCond, "ContentViewCondition");

            SWA.PropertyCondition contentViewPropCond = contentViewCond as SWA.PropertyCondition;
            Assert.IsNull(contentViewPropCond, "ContentViewCondition is not a PropertyCondition");

            SWA.AndCondition contentViewAndCond = contentViewCond as SWA.AndCondition; Assert.IsNull(contentViewPropCond, "ContentViewCondition is not a PropertyCondition");
            Assert.IsNull(contentViewAndCond, "ContentViewCondition is not a AndCondition");

            SWA.OrCondition contentViewOrCond = contentViewCond as SWA.OrCondition;
            Assert.IsNull(contentViewOrCond, "ContentViewCondition is not a OrCondition");

            SWA.NotCondition contentViewNotCond = contentViewCond as SWA.NotCondition;
            Assert.IsNotNull(contentViewNotCond, "ContentViewCondition is a NotCondition");

            SWA.Condition subCond = contentViewNotCond.Condition;
            Assert.IsNotNull(subCond, "ContentViewCondition.Condition");

            SWA.OrCondition subOrCond = subCond as SWA.OrCondition;
            Assert.IsNotNull(subOrCond, "ContentViewCondition.Condition is a OrCondition");

            SWA.Condition [] subSubConditions = subOrCond.GetConditions();
            Assert.AreEqual(2, subSubConditions.Length, "ContentViewCondition.Condition.GetConditions length");

            SWA.PropertyCondition subSubPropertyCond1 = subSubConditions [0] as SWA.PropertyCondition;
            Assert.IsNotNull(subSubPropertyCond1);
            SWA.PropertyCondition subSubPropertyCond2 = subSubConditions [1] as SWA.PropertyCondition;
            Assert.IsNotNull(subSubPropertyCond2);

            Assert.AreEqual(AEIds.IsControlElementProperty,
                            subSubPropertyCond1.Property,
                            "subcondition1 Property");
            Assert.AreEqual(false,
                            subSubPropertyCond1.Value,
                            "subcondition1 Value");
            Assert.AreEqual(SWA.PropertyConditionFlags.None,
                            subSubPropertyCond1.Flags,
                            "subcondition1 Flags");

            Assert.AreEqual(AEIds.IsContentElementProperty.ProgrammaticName,
                            subSubPropertyCond2.Property.ProgrammaticName,
                            "subcondition2 Property");
            Assert.AreEqual(false,
                            subSubPropertyCond2.Value,
                            "subcondition2 Value");
            Assert.AreEqual(SWA.PropertyConditionFlags.None,
                            subSubPropertyCond2.Flags,
                            "subcondition2 Flags");
        }
All Usage Examples Of System.Windows.Automation.OrCondition::GetConditions