Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualOrangeatang

Posted 03 March 2013 - 02:29 PM

I've got all of the properties for the engine's Object class registered using reflection :
 

PropertyDescriptorCollection propertyCollection = new PropertyDescriptorCollection(null, false);

// Get the properties
if( myObject != null )
{
   // Add the properties for the object
   PropertyInfo[] propertyInfo = myObject.GetType().GetProperties();
   foreach( PropertyInfo property in propertyInfo )
   {
     if( property.Name == "ID" )
     {
       propertyCollection.Add( new EngineObjectPropertyDescriptor(myObject, property.Name) );
     }
}

 

So at runtime the Object (myObject) get's it's ID member added to the PropertyGrid. I'm just testing this out on a single class member, so I can get the process down.

 

I've got Get/Set methods in the EngineObjectPropertyDescriptor, but they're just operating on the basic object type... is this where I need to trigger my custom property editor (in this case the Texture Browser)? It seems like the Set method would only get called once a value has been entered in to the text box for the string property (assuming I use a string to display to the user). At the moment Set is only getting called if I set the PropertyType to int32.


#3Orangeatang

Posted 03 March 2013 - 02:25 PM

I've got all of the properties for the engine's Object class registered using reflection :
 

PropertyDescriptorCollection propertyCollection = new PropertyDescriptorCollection(null, false);

// Get the properties
if( myObject != null )
{
   // Add the properties for the object
   PropertyInfo[] propertyInfo = myObject.GetType().GetProperties();
   foreach( PropertyInfo property in propertyInfo )
   {
     if( property.Name == "ID" )
     {
       propertyCollection.Add( new EngineObjectPropertyDescriptor(myObject, property.Name) );
     }
}

 

So at runtime the Object (myObject) get's it's ID member added to the PropertyGrid. I'm just testing this out on a single class member, so I can get the process down.

 

I've got Get/Set methods in the EngineObjectPropertyDescriptor, but they're just operating on the basic object type... is this where I need to trigger my custom property editor (in this case the Texture Browser)? It seems like the Set method would only get called once a value has been entered in to the text box for the string property (assuming I use a string to display to the user)


#2Orangeatang

Posted 03 March 2013 - 02:23 PM

I've got all of the properties for the engine's Object class registered using reflection :
 

PropertyDescriptorCollection propertyCollection = new PropertyDescriptorCollection(null, false);

// Get the properties
if( myObject != null )
{
   // Add the properties for the object
   PropertyInfo[] propertyInfo = myObject.GetType().GetProperties();
   foreach( PropertyInfo property in propertyInfo )
   {
     if( property.Name == "ID" )
     {
       propertyCollection.Add( new EngineObjectPropertyDescriptor(myObject, property.Name) );
     }
}

 

So at runtime the Object (myObject) get's it's ID member added to the PropertyGrid. I'm just testing this out on a single class member, so I can get the process down.

 

I've got Get/Set methods in the EngineObjectPropertyDescriptor, but they're just returning the basic object type... is that where I need to trigger the Texture Browser to select the new texture? It seems like the Set method would only get called once a value has been entered in to the text box for the string property (assuming I use a string to display to the user)


#1Orangeatang

Posted 03 March 2013 - 02:22 PM

I've got all of the properties for the engine's Object class registered using reflection :
 

PropertyDescriptorCollection propertyCollection = new PropertyDescriptorCollection(null, false);

// Get the properties
if( myObject != null )
{
   // Add the properties for the object
   PropertyInfo[] propertyInfo = myObject.GetType().GetProperties();
   foreach( PropertyInfo property in propertyInfo )
   {
     if( property.Name == "ID" )
     {
       propertyCollection.Add( new EngineObjectPropertyDescriptor(myObject, property.Name) );
     }
}

 

So at runtime the Object (myObject) get's it's ID member added to the PropertyGrid. 

 

I've got Get/Set methods in the EngineObjectPropertyDescriptor, but they're just returning the basic object type... is that where I need to trigger the Texture Browser to select the new texture? It seems like the Set method would only get called once a value has been entered in to the text box for the string property (assuming I use a string to display to the user)


PARTNERS