private void LoadNavigationEntities()
        {
            List <Type> avaliableToolStripItems =
                ReflectionAttributeHelper.GetCompriseCustomAttributeTypes <ToolStripItemEntityProvideAttribute>(_assembly, true);

            ToolStripItemEntityTypesFactory.Instance.Register(avaliableToolStripItems.ToArray());
        }
        private void LoadProvides()
        {
            List <AttributeAndTypeRelation> attributeAndTypeRelations =
                ReflectionAttributeHelper.GetAttributeAndTypeRelation <ResourceContentAttribute>(
                    Assembly.GetExecutingAssembly(), false);

            foreach (var item in attributeAndTypeRelations)
            {
                _attributes.Add((ResourceContentAttribute)item.Attribute, item.Type);
            }
        }
Beispiel #3
0
        public void Load()
        {
            List <AttributeAndTypeRelation> avaliableCells =
                ReflectionAttributeHelper.GetAttributeAndTypeRelation <PropertyGridCellProvideAttribute>(_assembly, false);
            IPropertyGirdCellsContainer propertyGirdCellsContainer = ServiceUnity.Container.Resolve <IPropertyGirdCellsContainer>();

            foreach (var item in avaliableCells)
            {
                PropertyGridCellProvideAttribute cellProvideAttribute = (PropertyGridCellProvideAttribute)item.Attribute;
                propertyGirdCellsContainer.Register(cellProvideAttribute.EditorAttribut, item.Type);
            }
        }
        private void LoadWindowComponts()
        {
            List <Type> rootComponet =
                ReflectionAttributeHelper.GetImplementInterfaceTypes <IWindowDesignerRootComponent>(_assembly);

            Debug.Assert(rootComponet.Count == 1, "找不到 DesignerHostEntityAttribute ,或 DesignerHostEntityAttribute 不止一个");
            _windowCompontsContainer.SetWindowDesignerRootComponent(rootComponet[0]);
            List <RuntimeControlToolboxItemAttribute> controls =
                ReflectionAttributeHelper.GetCustomAttributes <RuntimeControlToolboxItemAttribute>(_assembly, false);

            _windowCompontsContainer.SetShellControls(controls);
        }
        private void LoadWindowDevelopmentEntities()
        {
            List <Type> windowEntity =
                ReflectionAttributeHelper.GetCompriseCustomAttributeTypes <DesignerHostEntityAttribute>(_assembly, true);

            Debug.Assert(windowEntity.Count == 1, "找不到 DesignerHostEntityAttribute ,或 DesignerHostEntityAttribute 不止一个");
            WindowElementContainer windowElementContainer = WindowElementContainer.Instance;

            windowElementContainer.SetWindowEntityType(windowEntity[0]);
            List <Type> devElementEntities =
                ReflectionAttributeHelper.GetCompriseCustomAttributeTypes <NormalUIElementEntityProvideAttribute>(
                    _assembly, true);

            windowElementContainer.SetDevElementEntities(devElementEntities);
        }