473,386 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Dynamic UserScopedSettings

Is there a way to dynamically create user scoped settings? For example, a
lookup window inside an MDI application that is called by multiple forms and
needs to maintain it's size and position based on the MDI child form from
which it was called.
Feb 8 '06 #1
6 1992
Hi lloyduh234,

Thanks for your post.

Do you use .Net1.1 or .Net2.0? In .Net2.0, winform provided user scoped and
application scoped setting configuration file. For more information, please
refer to the link below:
http://msdn2.microsoft.com/en-us/library/c9db58th.aspx

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Feb 9 '06 #2
Thanks.
I'm using .Net 2.0 (c#). I realize there exists user scoped setting
configuration files. All the examples that I see show a somewhat static
wrapper class. I'm wondering if there are any examples of dynamic creation.
For example, I have a lookup window that needs to save it's position, size,
and grid column widths. The lookup window is called from multiple forms, and
presents different data for each form. I'd like to be able to persist
settings based on who called the lookup form.

""Jeffrey Tan[MSFT]"" wrote:
Hi lloyduh234,

Thanks for your post.

Do you use .Net1.1 or .Net2.0? In .Net2.0, winform provided user scoped and
application scoped setting configuration file. For more information, please
refer to the link below:
http://msdn2.microsoft.com/en-us/library/c9db58th.aspx

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Feb 9 '06 #3
Hi lloyduh234,

Thanks for your feedback.

I am not sure if I understand your scenario completely. It seems that you
want to persist the setting based on different form not based on the
different windows account, yes?

This requirement is somewhat like the Session concept in Asp.net. However,
there is no any build-in support for this in .Net winform.

If you want to do this, you have to implement some customized code to store
different settings. We should maintain some identification information in
the calling form, so that the lookup window can query to distinguish these
the callers. For example, we can use certain constructor of lookup window
to pass in certain identification information, then we can create a config
file based on different identification passed in.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Feb 10 '06 #4
Thanks.
What I tried was modifying the FormSettings example under the MSDN
ApplicationSettingsBaseClass example. In the constructor, I passed a string
that identifies the form name (_formName).
I then did the following:

[UserScopedSetting()]
[DefaultSettingValueAttribute("0, 0")'
public point FormLocation
{
get { return (Point)(this[_formName + "Location"]); }
set { this[_formName + "Location"] = value; }
}

This way, I could use one wrapper class across my entire application, and
just identify the settings by the calling form.

Should this have worked?

Thanks!

""Jeffrey Tan[MSFT]"" wrote:
Hi lloyduh234,

Thanks for your feedback.

I am not sure if I understand your scenario completely. It seems that you
want to persist the setting based on different form not based on the
different windows account, yes?

This requirement is somewhat like the Session concept in Asp.net. However,
there is no any build-in support for this in .Net winform.

If you want to do this, you have to implement some customized code to store
different settings. We should maintain some identification information in
the calling form, so that the lookup window can query to distinguish these
the callers. For example, we can use certain constructor of lookup window
to pass in certain identification information, then we can create a config
file based on different identification passed in.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Feb 10 '06 #5
Hi lloyduh234,

Yes, this should work. By doing this, each calling form will have an entry
in the user.config file, and whenever you access it, the corresponding
entry will return for the caller(since you have passed the correct calling
form name in the constructor)

If you still have anything unclear, please feel free to let me know. Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Feb 13 '06 #6
Just curious if this worked for you? I'm trying to do a similar thing, but
cant get it happening.

"lloyduh234" wrote:
Thanks.
What I tried was modifying the FormSettings example under the MSDN
ApplicationSettingsBaseClass example. In the constructor, I passed a string
that identifies the form name (_formName).
I then did the following:

[UserScopedSetting()]
[DefaultSettingValueAttribute("0, 0")'
public point FormLocation
{
get { return (Point)(this[_formName + "Location"]); }
set { this[_formName + "Location"] = value; }
}

This way, I could use one wrapper class across my entire application, and
just identify the settings by the calling form.

Should this have worked?

Thanks!

""Jeffrey Tan[MSFT]"" wrote:
Hi lloyduh234,

Thanks for your feedback.

I am not sure if I understand your scenario completely. It seems that you
want to persist the setting based on different form not based on the
different windows account, yes?

This requirement is somewhat like the Session concept in Asp.net. However,
there is no any build-in support for this in .Net winform.

If you want to do this, you have to implement some customized code to store
different settings. We should maintain some identification information in
the calling form, so that the lookup window can query to distinguish these
the callers. For example, we can use certain constructor of lookup window
to pass in certain identification information, then we can create a config
file based on different identification passed in.

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Apr 12 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Roel Wuyts | last post by:
CALL FOR CONTRIBUTIONS International Workshop on Revival of Dynamic Languages http://pico.vub.ac.be/~wdmeuter/RDL04/index.html (at OOPSLA2004, Vancouver, British Columbia, Canada, October...
0
by: Pascal Costanza | last post by:
Dynamic Languages Day @ Vrije Universiteit Brussel ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab,...
5
by: bearophileHUGS | last post by:
I often use Python to write small programs, in the range of 50-500 lines of code. For example to process some bioinformatics data, perform some data munging, to apply a randomized optimization...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.