Template documentation (readme)#9
Conversation
RussKie
left a comment
There was a problem hiding this comment.
Partial review of the first part of the readme.
A lot of random capitalisation, and there some long sentences which I personally found difficult to process, and I had to re-read those several times trying to grasp the idea. Please consider writing shorter sentences, as this could help making the document more approchable especially for the non-native English readers.
Also, please avoid using spaces in file names.
|
Oh wait for it. It's not the final version - I am still working on that. (German muscle memory strikes again! 😃) |
I suggest to change: NetControlDesigners/src/Templates/prepareTemplates.bat Lines 29 to 31 in 1e857e2 like that: This is what caused me confusing when I first read, and after I build templates too:
why is there a single number? This is very basic scenario, on practice you often will get several editors and plenty of properties in a single control... |
Not sure entirely what you mean, but I guess 4.7.2? And yes, I think I'll take your suggestion, and then merge it back into my repo here (I am currently working in a Microsoft repo which is still private, but I'll ping you first as soon as we're open that up.), so you can test it. Also, I'll continue discussing this with my boss @merriemcgaw today, and I think including the migration steps from a Framework based Type Editor makes perfect sense. I'd adapt a Framework version of this sample then, and we should include the important steps to go - with the help of the template - from Framework to .NET. |
I meant it should be plural - not single PropertyTypeName and not single TypeEditorName, but enumeration of several PropertyTypeNameS and several TypeEditorNameS.
---UPD--- Oh, I created a project according to the provided templates... I can admit that I was completely baffled. I thought the |
|
It's not the sample project. It's something more basic a general. Also I think one Type Editor per new template should be enough. If we add another Type Editor, we would need to add I think at least 10 additional class files, and I don't think that would add clarity. Again, I can offer you a 1:1 via teams or zoom, to take your most pressuring questions offline, if you like. I think I can quickly explain where most of the confusion comes from. |
|
In addition: It doesn't generate a test project. It only generates the skeleton of what's absolutely necessary to implement ONE type editor for ONE custom control. You will ALWAYS need 5 projects for ONE type editor, but you can then comparatively easy add additional controls and their respective type editors into those projects. |
|
I missed to push a commit, sorry, my bad. |
|
@KlausLoeffelmann Now I think I've got the point :)
I think now there is definitely no need for this, I will slowly understand the projects received from the templates and try to adapt them to the chart... At the moment the general gist is clear. I have only one question (non critical): I totally do not understand how it (winforms-datavisualization) manages to work now being in one .net6 project? Perhaps understanding this, it will be possible to come up with some kind of temporary workaround? Thank you once again, I hope to provide you with my feedback as I progress :) |
I am not sure I understand the question fully. You would provide the NuGet package which the template generated for a .NET 6 project. So, when you include the NuGet project which the template generates in a .NET 6 WinForms app, it just "takes" the control library (which is also targeting .NET) and uses it. And yes, the NuGet also contains the .NET Framework parts, and the Protocol (standard library), and the .NET 6 Designer Assembly - all of which are not used at runtime. Please keep the questions coming! Thanks, Klaus |
winforms-datavisualization (with custom designer and many custom editors) port is pure .Net6, one dll control. Which I compiled under the new designer SDK, slightly correcting and commenting out non-working things - that's all! And the new VS (up to 17.4) designer works with this control (if referenced by dll)! how can it be? If editors must be compiled for net472? |
|
VS 17.4 is still targeting ("written in") Framework 4.7.2. |
Some things are delegated behind the scenes:
Modal-Dialog-Type-Editors won't work. If you can show them at all, they will crash or hang Visual Studio. |
|
There is a new version of the readme - considerably extended, also based on your question. Please re-read it. I guess it will answer most of your additional questions. |
In readme of this PR I found only this:
In main readme I found this:
p1. is ok. In p2. I think italic part need a bit more clarification. And p3. is about modal dialogs again. So we make conclusion that complex types are types that need modal dialogs in editing... These dialogs are definably modal: And they've been working great (without any crash or even error) for almost a year now... |
|
Did the |
[
SRCategory("CategoryAttributeChart"),
SRDescription("DescriptionAttributeChart_Series"),
Editor(typeof(SeriesCollectionEditor), typeof(UITypeEditor)),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
]
public SeriesCollection Series
{
get
{
return _dataManager.Series;
}
}
[
SRCategory("CategoryAttributeData"),
Bindable(true),
SRDescription("DescriptionAttributeSeries_Points"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
Editor(typeof(DataPointCollectionEditor), typeof(UITypeEditor))
]
public DataPointCollection Points
{
get
{
return _points;
}
}And they are both (and several others) derived from: internal class ChartCollectionEditor : CollectionEditor {}: internal class DataPointCollectionEditor : ChartCollectionEditor {}
internal class SeriesCollectionEditor : ChartCollectionEditor {} |
|
Did you compare the behavior of the Collection Editors from Framework and the last working version of .NET? My suspicion here is that the custom editors did not get pulled it. Rather, the out-of-process Designer tried to provide its own collection editor functionality as well as it was able to. But then it may hit a spot, where customization was needed. It could have been pure luck, that it was somehow working before, but also probably never the way it was intended to work. I have currently no time to investigate that thoroughly, but maybe I can manage to take a quick look later this week. You would need to figure out, why custom collection type editors were needed to begin with. What are they doing that the intrinsic editors cannot do? If we need to implement a custom collection type editor for each type, that would be even more effort, unfortunately. There is also a sample ("Sophisticated") in this repo, showing, how custom collection editors are implemented. In a nutshell, you would need to provide additional functionality via Endpoints for the Collection operations like Add, Delete, Edit... . But, to be honest, there is a lot of assuming here. Let's take the time to get behind it. Also, Collection Editors will not be covered in the first part of the blog post. We need to get this basic information out first, and then we aim with the second part in the first quarter of next year. The reason is, we're thinking about steps to easing up the necessary boiler plate coding, especially for Collection Editors. |
|
I took a quick look: |
The only difference is that some custom properties don't have a color/picture icon. From here it follows that the GradientEditor does not work in .Net6 (it does not work on the properties of the chart itself too). This is also a good question - why (in my understanding it's p.1 may be p.2)? And of course why almost all of |
|
OK, give me quick pointer, so I don't need to browse all the threads: And also, which branch from which repo again should I get? |
|
Never mind, I got it. |
|
I'll post it anyway so it's in one place. |
|
Yes. It's in the chart serializer, where the Designer finds and instantiates the serializer on the server-side as expected but then can't call it's |





Ament