[Gtk-sharp-list] GeSettings status
Pablo Baena
pbaena@uol.com.ar
30 Apr 2003 22:50:35 +0000
--=-JWjJDyesrkdfUk1Vdh2r
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
For all the people that needs a way to store settings that is easy and
straightforward, I've commited a few changes in some free time to allow
the storing and retrieveing of any of the .NET primitives without
changing the API at all.
It is done this way:
interface IMySettings
{
[GeSettings.Property ("myMonoApp",
10,
Description = "Some int setting"
)]
int SomeNumber
{
get;
set;
}
event GeSettings.ChangedEventHandler SomeNumberChanged;
}
I only made the description optional.
If you are observative, you have noticed that added event to the
interface. Well, it is a new (optional) addition to get a notification
when the setting is updated. Currently it only notifies of changes
within the same instance of the program (not external changes), that is
just what I need right now (maybe in the future I can add this too).
I only have a bug to solve that is making it stall (a finally block
isn't being executed so a lock is not removed). I must track it because
in .NET it doesn't happen. So if you are interested you can check out
the code from http://gnomencoder.sourceforge.net#GeSettings and give me
a hand.
--
Pablo Baena <pbaena@uol.com.ar>
--=-JWjJDyesrkdfUk1Vdh2r
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/1.1.7">
</HEAD>
<BODY>
For all the people that needs a way to store settings that is easy and straightforward, I've commited a few changes in some free time to allow the storing and retrieveing of any of the .NET primitives without changing the API at all.<BR>
<BR>
It is done this way:<BR>
<BR>
<PRE> interface IMySettings
{
[GeSettings.Property ("myMonoApp",
10,
Description = "Some int setting"
)]
int SomeNumber
{
get;
set;
}
event GeSettings.ChangedEventHandler SomeNumberChanged;
}</PRE>
<BR>
I only made the description optional. <BR>
<BR>
If you are observative, you have noticed that added event to the interface. Well, it is a new (optional) addition to get a notification when the setting is updated. Currently it only notifies of changes within the same instance of the program (not external changes), that is just what I need right now (maybe in the future I can add this too).<BR>
<BR>
I only have a bug to solve that is making it stall (a finally block isn't being executed so a lock is not removed). I must track it because in .NET it doesn't happen. So if you are interested you can check out the code from <A HREF="http://gnomencoder.sourceforge.net">http://gnomencoder.sourceforge.net</A>#GeSettings and give me a hand. <BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
-- <BR>
Pablo Baena <<A HREF="mailto:pbaena@uol.com.ar">pbaena@uol.com.ar</A>>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
--=-JWjJDyesrkdfUk1Vdh2r--