示例#1
0
 void Initialize(IFactory <I> itemFactory)
 {
     Validate.ArgumentNotNull(parameter: itemFactory, parameterName: nameof(itemFactory));
     ItemFactory            = itemFactory;
     ExpandCollapseProvider = new ExpandCollapseImplementation(uiObject: this);
     SelectionProvider      = new SelectionImplementation <I>(uiObject: this, itemFactory: itemFactory);
     ValueProvider          = null;
 }
示例#2
0
 void Initialize(IFactory <I> itemFactory)
 {
     Validate.ArgumentNotNull(parameter: itemFactory, parameterName: nameof(itemFactory));
     ItemFactory           = itemFactory;
     MultipleViewProvider  = new MultipleViewImplementation(uiObject: this);
     ItemContainerProvider = new ItemContainerImplementation(uiObject: this);
     SelectionProvider     = new SelectionImplementation <I>(uiObject: this, itemFactory: itemFactory);
     TableProvider         = new TableImplementation <I>(uiObject: this, itemFactory: itemFactory);
 }
示例#3
0
        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);
                        }
                    }
                }
            }
        }
示例#4
0
 void Initialize(IFactory <I> itemFactory)
 {
     GridProvider      = new GridImplementation <I>(uiObject: this, itemFactory: itemFactory);
     SelectionProvider = new SelectionImplementation <I>(uiObject: this, itemFactory: itemFactory);
     ValueProvider     = new ValueImplementation(uiObject: this);
 }
示例#5
0
 private void OnSelectPrevious(object sender, ExecutedRoutedEventArgs e)
 {
     Performance.StartTiming(PerformanceMarks.SelectPrevious);
     SelectionImplementation.SelectPrevious(this.Context);
     Performance.StopTiming(PerformanceMarks.SelectPrevious);
 }
示例#6
0
 private void OnShowEvent(object sender, ExecutedToolEventArgs e)
 {
     SelectionImplementation.ShowDefaultEvent(this.Context);
 }