Comments (5)
Yes there is:
Please see the following class in CircuitEditor example for reference.
public class ModuleProperties : CustomTypeDescriptorNodeAdapter, IDynamicTypeDescriptor
Basically you need to subclass CustomTypeDescriptorNodeAdapter and override projected method GetPropertyDescriptors().
you can inspect the object and create list of descriptors using any conditions you like.
Alan
from atf.
That works perfectly for attributes on the selected DomNode. Any suggestions for if the DomNode is in an EmbeddedCollectionEditor?
from atf.
It should work fine for child DomNodes too as long as you register CustomTypeDescriptorNodeAdapter for each DomNodeTypes that have dynamic properties.
If this is not case then there is a bug, please let me know so I can fix it in next update.
Alan
from atf.
I have a CustomTypeDescriptorNodeAdapter for the child DomNode, which it is registered to in SchemaLoader using
Schema.childNodeName.Type.Define(new ExtensionInfo<DynamicChildNodeProperties>())
Updating the child DomNode's properties in an embedded collection does not update its dynamic properties.
from atf.
Here is a quick suggestion until I can address this issue with next Update.
I haven't setup a use case to reproduce this bug yet.
But tracing the code path it seems the problem is the property descriptors is cached for optimization purpose..
Try to comment out the code that caches the property descriptors and let me know if it is the case.
change GetPropertyDescriptors() method in class PropertyEditingContext
located at ..\Framework\Atf.Gui\Controls\PropertyEditing
// comment out caching
public static PropertyDescriptor[] GetPropertyDescriptors(PropertyEditingContext context)
{
if (context == null || context.m_selection.Length == 0)
return new PropertyDescriptor[0];
// don't use cach
//if (context.m_propertyDescriptors != null)
// return context.m_propertyDescriptors;
PropertyDescriptor[] result = context.CreatePropertyDescriptors();
// don't cache the result.
// context.m_propertyDescriptors = result;
return result;
}
Also comment out
//private PropertyDescriptor[] m_propertyDescriptors;
to avoid compiler warning as error.
Alan
from atf.
Related Issues (20)
- Saving projects with multiple files HOT 3
- Save button does not update in DomTreeEditor HOT 2
- Use other DLL in MEF, throw exception when load the assemblies. HOT 2
- Syntax Editor license question HOT 2
- Analysis of ATF source code by PVS-Studio static code analyzer HOT 2
- GlobalHistoryContext with multiple EditingContext on same DomNode HOT 7
- PropertyGrid does not update when using keyboard to select ListView item HOT 2
- <xs:all> nodes ignored by DomGen.exe HOT 2
- element minOccurs and maxOccurs are ignored by HOT 2
- Panel visiblity status is not reflected in the "Window" menu HOT 4
- Issue with Validatior/TransactionContext system HOT 1
- Redirect PropertyGrid data HOT 3
- Add "GeneratedCode" attribute to Schema class generated by DomGen
- Consider adding a strong name to DLLs. HOT 2
- DomNodeAdapter to TreeControl.Node
- Update SharpDX HOT 1
- isReadOnly parameter cannot by dynamic with defined editor HOT 3
- UnregisterMenu & Readding Menus HOT 2
- VirtualizingWrapPanel Error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atf.