コード例 #1
0
        public override ObjectDescriptor GetDescriptor()
        {
            ObjectDescriptor descriptor = new ObjectDescriptor();

            descriptor.Type        = NodeType.UIAControl;
            descriptor.Name        = this.NodeName;
            descriptor.Description = this.Description;

            if (_relation != null)
            {
                descriptor.SetItem <VisualRelationPropertyItem>(_relation);
            }

            IdentifyPropertyGroup item = new IdentifyPropertyGroup();

            item.Properties = _properties;
            item.Properties[ControlKeys.Type] = _type.ControlTypeToString();

            descriptor.SetItem <IdentifyPropertyGroup>(item);

            CachedPropertyGroup cachedGroup = GetContext <CachedPropertyGroup>();

            if (cachedGroup != null)
            {
                descriptor.SetItem <CachedPropertyGroup>(cachedGroup);
            }

            foreach (ITestObject to in Children)
            {
                ObjectDescriptor childDescriptor = to.GetDescriptor();
                descriptor.Children.Add(childDescriptor);
                childDescriptor.Parent = descriptor;
            }

            return(descriptor);
        }