设计时间editvalue / uitypeeditor脏 [英] design time editvalue / uitypeeditor dirty

查看:64
本文介绍了设计时间editvalue / uitypeeditor脏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的c#winform ui控件中有一个名为Items的自定义集合。

Items是内置集合类型,不允许自己

replace(你不能在控件中设置''itemscollection)。

但是,Items集合的内容是通过
$ b $保留的。 b designtime。


目前这一切都有效,除了以下内容。当您调出自定义集合编辑器并添加新项目时,然后关闭

集合编辑器。


我添加项目成功后通过

获取对控件的引用,清除项目集合,

然后重新添加所有项目,在editvalue中的基本控件。


这一切都有效,除了一个捕获,它从未认为该集合

已经改变。由于基本控件在

集合中没有''Set''访问器,由于某种原因,设计时间拒绝相信

它是可变的,即使它'已被编辑。


现在,如果我调整控件大小或更改其他属性,它会将

小星星放在表单名称上并保存它正确地序列化

项目集合。


所以我需要知道editvalue是否有办法迫使设计师

要知道物品集合是脏的(因此在名称中加上

小星星),这样他们就可以保存并让它序列化。

解决方案

我认为你应该使用RefreshPropertiesAttribute。


[RefreshProperties(RefreshProperties.All)]


FooCollection FooProperties

" alex sparsky" <人** @ sparkysystems.com>在消息中写道

news:bp ******************************** @ 4ax.com ...


我的c#winform ui控件中有一个名为Items的自定义集合。
Items是内置集合类型,不允许自己为
替换(你不能在控件中设置''itemscollection)。
然而,Items系列的内容通过
设计时间保持。

目前这一切都有效,除了以下内容。当您调出自定义集合编辑器并添加新项目时,请关闭
集合编辑器。

我成功后将项目添加到editvalue中的基本控件上获取对控件的引用,清除项目集合,然后重新添加所有项目。

这一切都有效,除了一个捕获,它从不认为集合
已经改变了。由于基本控件中的集合上没有设置访问器,由于某种原因,设计时间拒绝相信它即使已被编辑也是可以改变的。

现在如果我调整控件大小或更改其他属性,它会将
小星星放在表单名称上,当你保存它时,会正确序列化
项目集合。

所以我需要知道editvalue中是否有一种方法可以强迫设计师知道物品集合是脏的(因此在名称中贴上了小星星)这样他们就可以节省并将其序列化。



已经尝试过它并没有区别。我还在寻找解决方案。

周一,2005年12月19日20:00:18 +0200,Bele din Carpati < CR ******* @ mail.dntis.ro>写道:

我认为你应该使用RefreshPropertiesAttribute。

[RefreshProperties(RefreshProperties.All)]

FooCollection FooProperties
" alex sparsky" <人** @ sparkysystems.com>在消息中写道
新闻:bp ******************************** @ 4ax.com .. < blockquote class =post_quotes>
我的c#winform ui控件中有一个名为Items的自定义集合。
Items是一个内置集合类型,不允许自己替换(你不能在控件中设置'itemscollection。)
然而,Items系列的内容通过
设计时间保持不变。

目前这一切都有效除外以下。当您调出自定义集合编辑器并添加新项目时,请关闭
集合编辑器。

我成功后将项目添加到editvalue中的基本控件上获取对控件的引用,清除项目集合,然后重新添加所有项目。

这一切都有效,除了一个捕获,它从不认为集合
已经改变了。由于基本控件中的集合上没有设置访问器,由于某种原因,设计时间拒绝相信它即使已被编辑也是可以改变的。

现在如果我调整控件大小或更改其他属性,它会将
小星星放在表单名称上,当你保存它时,会正确序列化
项目集合。

所以我需要知道editvalue中是否有一种方法可以强迫设计师知道物品集合是脏的(因此在名称中贴上了小星星)这样他们就可以节省并将其序列化。




而不是尝试DesignerSerializationVisibilityAttribute


" alex sparsky <人** @ sparkysystems.com>在消息中写道

新闻:cq ******************************** @ 4ax.com ...

已经尝试过并且它没有任何区别。我还在寻找一个解决方案。

On Mon,2005年12月19日20:00:18 +0200,Bele din Carpati
< cr*******@mail.dntis.ro>写道:

我认为你应该使用RefreshPropertiesAttribute。

[RefreshProperties(RefreshProperties.All)]

FooCollection FooProperties
" alex sparsky" <人** @ sparkysystems.com>在消息中写道
新闻:bp ******************************** @ 4ax.com。 ..


我在我的c#winform ui控件中有一个名为Items的自定义集合。
Items是内置集合类型,不允许自己为
替换(你不能在控件中设置''itemscollection)。
然而,Items集合的内容通过
设计时间保持。

目前这个所有作品除以下内容外。当您调出自定义集合编辑器并添加新项目时,请关闭
集合编辑器。

我成功后将项目添加到editvalue中的基本控件上获取对控件的引用,清除项目集合,然后重新添加所有项目。

这一切都有效,除了一个捕获,它从不认为集合
已经改变了。由于基本控件中的集合上没有设置访问器,由于某种原因,设计时间拒绝相信它即使已被编辑也是可以改变的。

现在如果我调整控件大小或更改其他属性,它会将
小星星放在表单名称上,当你保存它时,会正确序列化
项目集合。

所以我需要知道editvalue中是否有一种方法可以强迫设计师知道物品集合是脏的(因此在名称中贴上了小星星)这样他们就可以节省并将其序列化。




I have a custom collection in my c# winform ui control called Items.
Items is a built in collection type that does not allow itself to be
replace (you can''t ''set'' the itemscollection in the control).
However, the contents of the Items collection is persisted through
designtime.

Currently this all works except for the following. When you bring up
the custom collection editor and add new items then close the
collection editor.

I add the items to the base control in the editvalue after success by
getting a reference to the control, clearing the items collection,
then re-adding all the items.

This all works except for one catch, it never thinks the collection
has changed. Since there is no ''Set'' accessor on the collection in
the base control, for some reason the design time refuses to believe
it is changable even though it''s been edited.

Now if I resize the control or change some other property, it puts the
little star on the forms name and when you save it properly serializes
the items collection.

So I need to know if there is a way in editvalue to force the designer
to know that the items collection is dirty (hence putting up the
little star in the name) so they can save and have it serialize out.

解决方案

I think you should use RefreshPropertiesAttribute.

[RefreshProperties(RefreshProperties.All)]

FooCollection FooProperties
"alex sparsky" <al**@sparkysystems.com> wrote in message
news:bp********************************@4ax.com...


I have a custom collection in my c# winform ui control called Items.
Items is a built in collection type that does not allow itself to be
replace (you can''t ''set'' the itemscollection in the control).
However, the contents of the Items collection is persisted through
designtime.

Currently this all works except for the following. When you bring up
the custom collection editor and add new items then close the
collection editor.

I add the items to the base control in the editvalue after success by
getting a reference to the control, clearing the items collection,
then re-adding all the items.

This all works except for one catch, it never thinks the collection
has changed. Since there is no ''Set'' accessor on the collection in
the base control, for some reason the design time refuses to believe
it is changable even though it''s been edited.

Now if I resize the control or change some other property, it puts the
little star on the forms name and when you save it properly serializes
the items collection.

So I need to know if there is a way in editvalue to force the designer
to know that the items collection is dirty (hence putting up the
little star in the name) so they can save and have it serialize out.



Tried that already and it made no difference. I''m still looking for a solution to this.
On Mon, 19 Dec 2005 20:00:18 +0200, "Bele din Carpati" <cr*******@mail.dntis.ro> wrote:

I think you should use RefreshPropertiesAttribute.

[RefreshProperties(RefreshProperties.All)]

FooCollection FooProperties
"alex sparsky" <al**@sparkysystems.com> wrote in message
news:bp********************************@4ax.com.. .


I have a custom collection in my c# winform ui control called Items.
Items is a built in collection type that does not allow itself to be
replace (you can''t ''set'' the itemscollection in the control).
However, the contents of the Items collection is persisted through
designtime.

Currently this all works except for the following. When you bring up
the custom collection editor and add new items then close the
collection editor.

I add the items to the base control in the editvalue after success by
getting a reference to the control, clearing the items collection,
then re-adding all the items.

This all works except for one catch, it never thinks the collection
has changed. Since there is no ''Set'' accessor on the collection in
the base control, for some reason the design time refuses to believe
it is changable even though it''s been edited.

Now if I resize the control or change some other property, it puts the
little star on the forms name and when you save it properly serializes
the items collection.

So I need to know if there is a way in editvalue to force the designer
to know that the items collection is dirty (hence putting up the
little star in the name) so they can save and have it serialize out.




than try DesignerSerializationVisibilityAttribute

"alex sparsky" <al**@sparkysystems.com> wrote in message
news:cq********************************@4ax.com...

Tried that already and it made no difference. I''m still looking for a
solution to this.
On Mon, 19 Dec 2005 20:00:18 +0200, "Bele din Carpati"
<cr*******@mail.dntis.ro> wrote:

I think you should use RefreshPropertiesAttribute.

[RefreshProperties(RefreshProperties.All)]

FooCollection FooProperties
"alex sparsky" <al**@sparkysystems.com> wrote in message
news:bp********************************@4ax.com. ..


I have a custom collection in my c# winform ui control called Items.
Items is a built in collection type that does not allow itself to be
replace (you can''t ''set'' the itemscollection in the control).
However, the contents of the Items collection is persisted through
designtime.

Currently this all works except for the following. When you bring up
the custom collection editor and add new items then close the
collection editor.

I add the items to the base control in the editvalue after success by
getting a reference to the control, clearing the items collection,
then re-adding all the items.

This all works except for one catch, it never thinks the collection
has changed. Since there is no ''Set'' accessor on the collection in
the base control, for some reason the design time refuses to believe
it is changable even though it''s been edited.

Now if I resize the control or change some other property, it puts the
little star on the forms name and when you save it properly serializes
the items collection.

So I need to know if there is a way in editvalue to force the designer
to know that the items collection is dirty (hence putting up the
little star in the name) so they can save and have it serialize out.



这篇关于设计时间editvalue / uitypeeditor脏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆