UI Type Editor question


Author
Message
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Perfect analogy! Lol now the problem is I am thinking about all sorts of other things I can do instead of the problem at hand Smile  Thanks alot for the help it rhelped me bypass a bunch of google time.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Paul Chase (10/27/2006)
This is Awesome!! Thanks alot for the help.. Feel like I just opened my eyes after walking around with em closed!!

When I started with reflection, I felt like I was playing Doom3... you're walking around an absolutely huge, pitch-black room with nothing but a dinky flashlight, so you can only look at one thing at a time.  However, once you've gone through the game a few times, you can navigate the room by by touch because you know where everything is Smile

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Actually, now that I think about it, you can get the executing assembly, you just cannot get the entry assembly.  However, you might want to still use the AppDomain trick just in case your report is not located within the same assembly as your type editor.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Something like that... however, you won't be able to get the executing assembly at design-time... you'll probably have to do this:

For Each loAssembly As Assembly In AppDomain.CurrentDomain.GetAssemblies()
    '-- Don't check the assembly if the name starts with System, DevExpress, Microsoft, etc.
    If loAssembly.Name.FullName.StartsWith("System") OrElse _ ' etc...  Then
        '-- Cycle through all of the types...
    End If
Next

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
This is Awesome!! Thanks alot for the help.. Feel like I just opened my eyes after walking around with em closed!!
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Something like this

Dim LoAssy As Reflection.Assembly = Reflection.Assembly.GetExecutingAssembly()

For Each loType As Type In LoAssy.GetTypes()

If loType.IsSubclassOf(GetType(ReportEngine.XtraReportBase)) Then

populate combo or something

End If

Next


StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
No, you're on the right track... in fact, that's what we do with the ListPopulation type editors.  Once you have an Assembly object, you can call GetTypes() which will return a Type array containing all of the public types (by default, but you can specify flags to grab the private types as well), and on each one you can check if Type.IsSubClassOf(GetType(xtrareport)) then add it to the list and once they select one of the types, then you can create a new instance of it and stuff it in the property value using that context.PropertyDescriptor.SetValue() method.
Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Lol I can handle that I'll make it a double!

How bout another question?

I have a property called report and its type is "xtrareportbase" which is my sublass of an xtrareport. Of course in the property sheet this is a dropdown but a devexpress xtrareport is not a component so I canot drag one onto the design surface to allow it to be selected from the combo.

I am thinking that I will have to follow the same idea of using a ui type editor and type converter and then use reflection to loop through the assemply to find all the report types in the project to be able to select the one i want and then update the property grid. Does this sound like I'm going down the right path or am I in the weeds again?

StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
So that worked?  I'm glad. Smile

Oh, and you're off the hook because I don't drink... unless you consider a chocolate milk shake a hard drink Wink

Paul Chase
Paul Chase
Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)Advanced StrataFrame User (576 reputation)
Group: Forum Members
Posts: 414, Visits: 2.8K
Thanks Ben that was exactly what I was looking for half the night. I owe ya a drink or 4

Thanks Again

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search