void Initialize(IFactory <C> containerFactory, IFactory <I> itemFactory) { Validate.ArgumentNotNull(parameter: itemFactory, parameterName: nameof(itemFactory)); ItemFactory = itemFactory; ExpandCollapseProvider = new ExpandCollapseImplementation(uiObject: this); SelectionItemProvider = new SelectionItemImplementation <C>(uiObject: this, containerFactory: containerFactory); }
void AddSupportedPatterns(UIObject uiObjectToAdd, XmlNode nodeToPopulate) { foreach (var supportedPattern in uiObjectToAdd.GetSupportedPatterns()) { if (supportedPattern != null) { if (supportedPattern.ProgrammaticName == DockPatternIdentifiers.Pattern.ProgrammaticName) { IDock dock = new DockImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: dock); } else if (supportedPattern.ProgrammaticName == ExpandCollapsePatternIdentifiers.Pattern.ProgrammaticName) { IExpandCollapse expandCollapse = new ExpandCollapseImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: expandCollapse); } else if (supportedPattern.ProgrammaticName == RangeValuePatternIdentifiers.Pattern.ProgrammaticName) { IRangeValue rangeValue = new RangeValueImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: rangeValue); } else if (supportedPattern.ProgrammaticName == ScrollPatternIdentifiers.Pattern.ProgrammaticName) { IScroll scroll = new ScrollImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: scroll); } else if (supportedPattern.ProgrammaticName == TogglePatternIdentifiers.Pattern.ProgrammaticName) { IToggle toggle = new ToggleImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: toggle); } else if (supportedPattern.ProgrammaticName == TransformPatternIdentifiers.Pattern.ProgrammaticName) { ITransform transform = new TransformImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: transform); } else if (supportedPattern.ProgrammaticName == WindowPatternIdentifiers.Pattern.ProgrammaticName) { IWindow window = new WindowImplementation(uiObject: uiObjectToAdd); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: window); } else { if (supportedPattern.ProgrammaticName == SelectionItemPattern.Pattern.ProgrammaticName) { ISelectionItem <UIObject> selectionItem = new SelectionItemImplementation <UIObject>(uiObject: uiObjectToAdd, containerFactory: UIObject.Factory); AddPropertiesAsXmlAttributes(nodeToPopulate: nodeToPopulate, currObject: selectionItem); break; } if (supportedPattern.ProgrammaticName == SelectionPattern.Pattern.ProgrammaticName) { var selectionImplementation = new SelectionImplementation <UIObject>(uiObject: uiObjectToAdd, itemFactory: UIObject.Factory); var empty = string.Empty; foreach (var uiObject in selectionImplementation.Selection) { if (empty != string.Empty) { empty += ";"; } empty += uiObject.RuntimeId; } var attribute = this._xmlDoc.CreateAttribute(name: "Selection"); attribute.Value = empty; nodeToPopulate.Attributes.Append(node: attribute); } } } } }
void Initialize(IFactory <C> containerFactory) { SelectionItemProvider = new SelectionItemImplementation <C>(uiObject: this, containerFactory: containerFactory); }
void Initialize(IFactory <C> containerFactory) { SelectionItemProvider = new SelectionItemImplementation <C>(uiObject: this, containerFactory: containerFactory); ScrollItemProvider = new ScrollItemImplementation(uiObject: this); VirtualizedItemProvider = new VirtualizedItemImplementation(uiObject: this); }