상속: System.Attribute
예제 #1
0
        private void AddMonthViewAttributes()
        {
            AddCallback(typeof(FXMonthView), builder =>
            {
                builder.AddCustomAttributes(FXMonthView.ButtonStyleProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.WeekDayHeaderStyleProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.HeaderMonthStyleProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.DayContainerStyleProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.HeaderYearStyleProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.DayContainerStyleSelectorProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.DayTemplateSelectorProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.DayTemplateProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.ViewPreChangeAnimationProperty, BrowsableAttribute.No);
                builder.AddCustomAttributes(FXMonthView.ViewPostChangeAnimationProperty, BrowsableAttribute.No);

                var behaviorCategory = new CategoryAttribute("Behavior");
                builder.AddCustomAttributes(FXMonthView.ViewDateTimeProperty, behaviorCategory);
                builder.AddCustomAttributes(FXMonthView.SelectedDateTimeProperty, behaviorCategory);
                builder.AddCustomAttributes(FXMonthView.ShowTodayButtonProperty, behaviorCategory);
                builder.AddCustomAttributes(FXMonthView.ShowEmptyButtonProperty, behaviorCategory);
                builder.AddCustomAttributes(FXMonthView.ShowWeekDayNamesProperty, behaviorCategory);
                builder.AddCustomAttributes(FXMonthView.MaxDateProperty, behaviorCategory);
                builder.AddCustomAttributes(FXMonthView.MinDateProperty, behaviorCategory);

                builder.AddCustomAttributes();
            });
        }
예제 #2
0
        /// <summary>
        /// To register design time metadata for SSWCD.Legend.
        /// </summary>
        public CustomControl1Metadata()
            : base()
        {
            AddCallback(
                typeof(CustomControl1),
                b =>
                {
                    /*b.AddCustomAttributes(
                        Extensions.GetMemberName<CustomControl1>(x => x.Items),
                        new BrowsableAttribute(false));*/

                    b.AddCustomAttributes(new FeatureAttribute(typeof(OpacitySliderAdornerProvider)));

                    b.AddCustomAttributes(
                        Extensions.GetMemberName<CustomControl1>(x => x.Title),
                        new CategoryAttribute(Properties.Resources.CommonProperties));

                    //b.AddCustomAttributes(
                    //    Extensions.GetMemberName<CustomControl1>(x => x.Opacity),new FeatureAttribute(typeof(OpacitySliderAdornerProvider)));

                    CategoryAttribute calendarCategory = new CategoryAttribute("VollDepp");
                    b.AddCustomAttributes(CustomControl1.MyPropertyProperty, calendarCategory);

                    /*b.AddCustomAttributes(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.Items),
                        new CategoryAttribute(Properties.Resources.DataVisualization));
                    b.AddCustomAttributes(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.TitleStyle),
                        new CategoryAttribute(Properties.Resources.DataVisualizationStyling));

                    b.AddCustomAttributes(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.Title),
                        PropertyValueEditor.CreateEditorAttribute(typeof(TextBoxEditor)));

                    b.AddCustomAttributes(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.Items),
                        new NewItemTypesAttribute(typeof(SSWCDC.LegendItem)));

                    b.AddCustomAttributes(new DefaultBindingPropertyAttribute(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.Items)));*/

            #if MWD40
                    /*b.AddCustomAttributes(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.Title),
                        new AlternateContentPropertyAttribute());

                    b.AddCustomAttributes(new ToolboxCategoryAttribute(ToolboxCategoryPaths.DataVisualizationControlParts, false));

                    b.AddCustomAttributes(
                        Extensions.GetMemberName<SSWCD.Legend>(x => x.TitleStyle),
                        new DataContextValueSourceAttribute(
                            Extensions.GetMemberName<SSWCD.Legend>(x => x.Title),
                            false));*/
            #endif
                });
        }
예제 #3
0
        // Determine if two instances of this class are equal.
        public override bool Equals(Object obj)
        {
            CategoryAttribute other = (obj as CategoryAttribute);

            if (other != null)
            {
                return(Category == other.Category);
            }
            else
            {
                return(false);
            }
        }
예제 #4
0
        public static string GetCategory(ICustomAttributeProvider t)
        {
            if (t == null)
            {
                throw new ArgumentNullException("t");
            }

            System.ComponentModel.CategoryAttribute cat = ReflectionHelper.GetAttribute <System.ComponentModel.CategoryAttribute>(t);
            if (cat == null)
            {
                return("");
            }
            return(cat.Category);
        }
        internal static void RegisterMetadata(AttributeTableBuilder builder)
        {
            var serviceType = typeof(WorkflowService);
            var advancedAttribute = new EditorBrowsableAttribute(EditorBrowsableState.Advanced);
            var categoryAttribute = new CategoryAttribute(EditorCategoryTemplateDictionary.Instance.GetCategoryTitle(MiscellaneousCategoryLabelKey));

            builder.AddCustomAttributes(serviceType, new DesignerAttribute(typeof(ServiceDesigner)));
            builder.AddCustomAttributes(serviceType, "Name", new TypeConverterAttribute(typeof(XNameConverter)));
            builder.AddCustomAttributes(serviceType, serviceType.GetProperty("Endpoints"), BrowsableAttribute.No);
            builder.AddCustomAttributes(
                serviceType,
                "ImplementedContracts", 
                advancedAttribute, 
                categoryAttribute, 
                PropertyValueEditor.CreateEditorAttribute(typeof(TypeCollectionPropertyEditor)), 
                new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.AllowDuplicate, Value = false },
                new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.Filter, Value = ServiceContractImporter.FilterFunction },
                new EditorOptionAttribute { Name = TypeCollectionPropertyEditor.DefaultType, Value = null });
            builder.AddCustomAttributes(serviceType, serviceType.GetProperty("Body"), BrowsableAttribute.No);
        }
예제 #6
0
 private static CategoryAttribute GetStdCategory(String name)
 {
     lock (typeof(CategoryAttribute))
     {
         CategoryAttribute attr;
         if (stdCategories == null)
         {
             stdCategories = new Hashtable();
         }
         else
         {
             attr = (CategoryAttribute)(stdCategories[name]);
             if (attr != null)
             {
                 return(attr);
             }
         }
         attr = new CategoryAttribute(name);
         stdCategories[name] = attr;
         return(attr);
     }
 }
	private static CategoryAttribute GetStdCategory(String name)
			{
				lock(typeof(CategoryAttribute))
				{
					CategoryAttribute attr;
					if(stdCategories == null)
					{
						stdCategories = new Hashtable();
					}
					else
					{
						attr = (CategoryAttribute)(stdCategories[name]);
						if(attr != null)
						{
							return attr;
						}
					}
					attr = new CategoryAttribute(name);
					stdCategories[name] = attr;
					return attr;
				}
			}
예제 #8
0
파일: CategoryItem.cs 프로젝트: GonzRu/WPG
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoryItem"/> class.
 /// </summary>
 /// <param name="owner">The owner.</param>
 /// <param name="category">The category.</param>
 public CategoryItem(PropertyGrid owner, CategoryAttribute category)
     : this(owner, category.Category)
 {
     Attribute = category;
 }
예제 #9
0
		public void CustomCategory ()
		{
			var ca = new CM.CategoryAttribute ("Foo Category");
			Assert.AreEqual ("Foo Category", ca.Category);
		}
        public void CustomCategory()
        {
            var ca = new CM.CategoryAttribute("Foo Category");

            Assert.AreEqual("Foo Category", ca.Category);
        }