Trouble with TypeConverter


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Cool...glad it worked out for you! Smile
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I had a chance (finally) to look at this. I got it working quite easily using your changes as a guide! w00t



I see now that I needed to always have an instance of the property object (the TopMostNode), rather than using Nothing. Thanks again for the top notch support (above and beyond...). BigGrin
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
No problem on the delay. Thanks I'll take a look at it! This is much appreciated. You guys rock! BigGrin
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
OK....sorry for the REALLY long delay on this one.  But I have changed your code to work more in line with what I would do.  You will always want to have an instance of the object of some sort.  Instead of testing on Nothing, just test on a -1 for the ID or something along those lines.  You can also add a method on your TopMostNode item that tells if you it is in a default state to make this easier instead of writing the same thing over and over again (I did not write that method, but you get my point).
Attachments
ExpandableTypeConverterTest.zip (163 views, 78.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Totally understand. Hope training is going well (I'm sure it is). I wish I was there. Ermm I'm going to try for the next one. Thanks for any time you can spare to take a quick look.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Sorry, Greg.  We have just been swamped lately.  We are in class this week (and actually next as well).  So things should return to normal the last week of the month...but I will really try to look at this one night.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I know y'all are busy, but if anyone gets chance, I've love some feedback/correction about what I'm doing wrong with this type converter. Ermm
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
That did indeed help with serialization, but not much else. I'm attaching a small project with the basics. If you get a chance, could take a quick look and see if you can spot anything glaringly wrong? I have a feeling I "that close" BigGrin
Attachments
ExpandableTypeConverterTest.zip (151 views, 20.00 KB)
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Welcome to the world of frustrations BigGrin  Yeah, creating design-time implementations can make you cuss!

One thing that you may be dealing with is the serialization as you mentioned.  If you have a collection, then you will want to assign the Content tag through the DesignerSerializationVisibility property.  Like this:

Imports System.ComponentModel

Public Class MyTest

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
    Public Property MyProperty() As MyCollection
        Get

        End Get
        Set(ByVal value As MyCollection)

        End Set
    End Property

End Class

This might get you going in the right direction or at point you towards another attribute that would help.  The above tag can be used to just ensure that the serialization is visible as well.

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
This is getting very frustrating. I sort of got it working, but not in an acceptable manner. I the control, I added some code that would return a newly initialized object if in designmode and if the object was Nothing(null). This solution would mean that I'd have to remember to add that code any place I use this object...not good.



I'm starting to think this might have something to do with serialization. What do I need to do to make this property serialize correctly? Currently it is doing this...which isn't really working:



Me.dtvOutline.TopMostNode = CType(resources.GetObject("dtvOutline.TopMostNode"), FOXSystems.RAMS.UI.Forms.Controls.TopMostTreeNode)




What I'd expect is something more alone these lines:

Me.dtvOutline.TopMostNode.TopMostText = "(unassigned)"

Me.dtvOutline.TopMostNode.TopMostID = 0




The TopMostNode is of type TopMostTreeNode, which has been marked with the TypeConverter, Serializable and Browsable(True) attributes. What am I missing?
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