IncludeMember() публичный Метод

public IncludeMember ( string memberToInclude, Type type, MemberChangeEventHandler memberChangeAction, Func getMember, TypeConverter converter = null, Attribute attributes = null ) : PropertyGridMember
memberToInclude string
type Type
memberChangeAction MemberChangeEventHandler
getMember Func
converter TypeConverter
attributes Attribute
Результат PropertyGridMember
Пример #1
0
        public TileMapInfoWindow()
        {
            InitializeComponent();

            mDisplayer = new PropertyGridDisplayer();

            mDisplayer.ExcludeMember("TileWidth");
            mDisplayer.ExcludeMember("TileHeight");

            mDisplayer.IncludeMember("Cell Width", 
                typeof(string), 
                SetNumberOfTilesWide,
                GetTileWidth,
                new SpriteSheetCellWidthConverter());

            mDisplayer.IncludeMember("Cell Height",
                typeof(string),
                SetNumberOfTilesTall,
                GetTileHeight,
                new SpriteSheetCellWidthConverter());


        }
Пример #2
0
        public static void ShowAllElementVariablesInPropertyGrid()
        {
            PropertyGridDisplayer displayer = new PropertyGridDisplayer();
            displayer.Instance = GlueState.Self.CurrentElement;
            displayer.ExcludeAllMembers();
            displayer.RefreshOnTimer = false;
            
            displayer.PropertyGrid = MainGlueWindow.Self.PropertyGrid;


            foreach (CustomVariable variable in GlueState.Self.CurrentElement.CustomVariables)
            {
                Type type = variable.GetRuntimeType();
                if (type == null)
                {
                    type = typeof(string);
                }

                string name = variable.Name;
                object value = variable.DefaultValue;
                TypeConverter converter = variable.GetTypeConverter(GlueState.Self.CurrentElement);


                displayer.IncludeMember(name, type,
                    delegate(object sender, MemberChangeArgs args)
                    {
                        GlueState.Self.CurrentElement.GetCustomVariableRecursively(name).DefaultValue = args.Value;
                    }
                    ,
                    delegate()
                    {
                        return GlueState.Self.CurrentElement.GetCustomVariableRecursively(name).DefaultValue;
                    },
                    converter);
            
            }
            MainGlueWindow.Self.PropertyGrid.SelectedObject = displayer;
        }