<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>microsoft.public.dotnet.languages.csharp Latest Posts</title><link>http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.dotnet.languages.csharp</link><description>This feed provides the latest posts to the C# newsgroup on news.microsoft.com</description><item><title>Connect to databace error (Login and Register)</title><guid isPermaLink="false" /><description>Does any one know how to fix this error?&lt;br&gt;    Validation of viewstate MAC failed. If this application is hosted by a &lt;br&gt;Web Farm or cluster, ensure that &lt;machineKey&gt; configuration specifies the &lt;br&gt;same validationKey and validation algorithm. AutoGenerate cannot be used in &lt;br&gt;a cluster.&lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;Nick &lt;br&gt;</description><pubDate>Mon, 8 Feb 2010 21:04:33 -0500</pubDate><category>C# newsgroup post</category><dc:creator>"Nick" &lt;doctorevil@thebonavitas.com&gt;</dc:creator></item><item><title>Re: C# Keyboard Hook Problems</title><guid isPermaLink="false" /><description>Hi Daniel,&lt;br&gt;&lt;br&gt;thats what a valid call looks like:&lt;br&gt;&lt;br&gt;SetWindowsHookEx(WH_KEYBOARD_LL,&lt;br&gt;                    LowLevelKeyboardHookProc,&lt;br&gt;                    Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]),&lt;br&gt;                    0);&lt;br&gt;&lt;br&gt;CallingConvention = CallingConvention.StdCall is not needed and set CharSet&lt;br&gt;to CharSet.Unicode if you strictly run on windows NT systems.&lt;br&gt;&lt;br&gt;The callback delegate should look like that:&lt;br&gt;&lt;br&gt;private delegate IntPtr LowLevelKeyboardProcDelegate(int nCode, int wParam, &lt;br&gt;IntPtr lParam);&lt;br&gt;&lt;br&gt;Then it works fine,...&lt;br&gt;&lt;br&gt;Regards&lt;br&gt;&lt;br&gt;Kerem&lt;br&gt;&lt;br&gt;-- &lt;br&gt; -----------------------&lt;br&gt;Beste Gr|sse / Best regards / Votre bien devoue&lt;br&gt;Kerem G|mr|kc|&lt;br&gt;Latest Project: http://www.pro-it-education.de/software/deviceremover&lt;br&gt;Latest Open-Source Projects: http://entwicklung.junetz.de&lt;br&gt;-----------------------&lt;br&gt;&lt;br&gt;"dsheiner" &lt;daniel.s1@gmail.com&gt; schrieb im Newsbeitrag &lt;br&gt;news:afd73d37-a909-42f0-8072-e4febb41b44e@o16g2000vbf.googlegroups.com...&lt;br&gt;&gt; Hi,&lt;br&gt;&gt;&lt;br&gt;&gt; I'm trying to implement a keyboard hook that will receive all keyboard&lt;br&gt;&gt; events within my application, and only my application, using C# .NET&lt;br&gt;&gt; 3.5 and VS 2008.&lt;br&gt;&gt;&lt;br&gt;&gt; I'm using the following code:&lt;br&gt;&gt;&lt;br&gt;&gt; private delegate IntPtr KeyboardHookCallback(int nCode, IntPtr wParam,&lt;br&gt;&gt; IntPtr lParam);&lt;br&gt;&gt;&lt;br&gt;&gt; private static KeyboardHookCallback _callback = new&lt;br&gt;&gt; KeyboardHookCallback(HookCallback);&lt;br&gt;&gt; private const int WH_KEYBOARD_LL = 13;&lt;br&gt;&gt;&lt;br&gt;&gt; private static IntPtr SetHook()&lt;br&gt;&gt; {&lt;br&gt;&gt;     return SetWindowsHookEx(WH_KEYBOARD_LL, _callback, IntPtr.Zero,&lt;br&gt;&gt; Thread.CurrentThread.ManagedThreadId);&lt;br&gt;&gt; }&lt;br&gt;&gt;&lt;br&gt;&gt; [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true,&lt;br&gt;&gt; CallingConvention = CallingConvention.StdCall)]&lt;br&gt;&gt; private static extern IntPtr SetWindowsHookEx(int idHook,&lt;br&gt;&gt; KeyboardHookCallback lpfn, IntPtr hMod, int threadId);&lt;br&gt;&gt;&lt;br&gt;&gt; SetWindowsHookEx is returning 0, and Marshal.GetLastWin32Error() is&lt;br&gt;&gt; returning 87.  I understand this means there's an invalid parameter,&lt;br&gt;&gt; but that's as far as I can get.  I've tried using WH_KEYBOARD (2)&lt;br&gt;&gt; instead of WH_KEYBOARD_LL, and I've tried the deprecated&lt;br&gt;&gt; AppDomain.GetCurrentThreadId(), but this doesn't seem to make a&lt;br&gt;&gt; difference.  Any idea where I've gone wrong?&lt;br&gt;&gt;&lt;br&gt;&gt; Thanks,&lt;br&gt;&gt; Daniel Sheiner &lt;br&gt;</description><pubDate>Tue, 9 Feb 2010 02:05:07 +0100</pubDate><category>C# newsgroup post</category><dc:creator>=?iso-8859-1?B?S2VyZW0gR/xtcvxrY/w=?= &lt;kareem114@hotmail.com&gt;</dc:creator></item><item><title>try debugging design-time</title><guid isPermaLink="false" /><description>I recently ran into an issue where a designer exploded (thanks VS) and i had a need to debug the designer in order to find where the exception was arising.  Here is a great article that explains how to debug visual studio at design time.  It's actually rather simple.  Perhaps this can help.&lt;br&gt;&lt;br&gt;http://www.codeproject.com/KB/cs/wsod.aspx&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Peter Duniho wrote:&lt;br&gt;&lt;br&gt;Jeff Gaines wrote:I agree.&lt;br&gt;04-Feb-10&lt;br&gt;&lt;br&gt;Jeff Gaines wrote:

I agree.  It sounds like you really do have a composite control, which
is exactly the use case UserControl is intended for.


Right?for designing purposes, the Designer needs to create the base
version, and then it layers its own stuff on top.  it is not actually
manipulating an instance of the type being designed, so it is okay for
that type to not be instantiable.

It seems to me that as long as you do not find yourself in a situation
where you _do_ need to design using the abstract type ? for example, you
want to be able to further do design work on the derived types ? that it
being abstract should not be a problem.

If I understand you correctly, the only difference between the plain
text and RTF versions is in fact the handling of the formatting, then
presumably that means you do not need to design those type individually,
and so having an abstract base class is not a problem.

Pete&lt;br&gt;&lt;br&gt;Previous Posts In This Thread:&lt;br&gt;&lt;br&gt;&lt;br&gt;Submitted via EggHeadCafe - Software Developer Portal of Choice &lt;br&gt;Using the MS Text Driver to read Delimited  Files&lt;br&gt;http://www.eggheadcafe.com/tutorials/aspnet/c77b7a8d-5240-402e-b5c2-3895d1a2df28/using-the-ms-text-driver.aspx</description><pubDate>Mon, 08 Feb 2010 16:39:02 -0800</pubDate><category>C# newsgroup post</category><dc:creator>Matthew Phillips</dc:creator></item><item><title>C# Keyboard Hook Problems</title><guid isPermaLink="false" /><description>Hi,&lt;br&gt;&lt;br&gt;I'm trying to implement a keyboard hook that will receive all keyboard&lt;br&gt;events within my application, and only my application, using C# .NET&lt;br&gt;3.5 and VS 2008.&lt;br&gt;&lt;br&gt;I'm using the following code:&lt;br&gt;&lt;br&gt;private delegate IntPtr KeyboardHookCallback(int nCode, IntPtr wParam,&lt;br&gt;IntPtr lParam);&lt;br&gt;&lt;br&gt;private static KeyboardHookCallback _callback = new&lt;br&gt;KeyboardHookCallback(HookCallback);&lt;br&gt;private const int WH_KEYBOARD_LL = 13;&lt;br&gt;&lt;br&gt;private static IntPtr SetHook()&lt;br&gt;{&lt;br&gt;     return SetWindowsHookEx(WH_KEYBOARD_LL, _callback, IntPtr.Zero,&lt;br&gt;Thread.CurrentThread.ManagedThreadId);&lt;br&gt;}&lt;br&gt;&lt;br&gt;[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true,&lt;br&gt;CallingConvention = CallingConvention.StdCall)]&lt;br&gt;private static extern IntPtr SetWindowsHookEx(int idHook,&lt;br&gt;KeyboardHookCallback lpfn, IntPtr hMod, int threadId);&lt;br&gt;&lt;br&gt;SetWindowsHookEx is returning 0, and Marshal.GetLastWin32Error() is&lt;br&gt;returning 87.  I understand this means there's an invalid parameter,&lt;br&gt;but that's as far as I can get.  I've tried using WH_KEYBOARD (2)&lt;br&gt;instead of WH_KEYBOARD_LL, and I've tried the deprecated&lt;br&gt;AppDomain.GetCurrentThreadId(), but this doesn't seem to make a&lt;br&gt;difference.  Any idea where I've gone wrong?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Daniel Sheiner</description><pubDate>Mon, 8 Feb 2010 16:19:24 -0800 (PST)</pubDate><category>C# newsgroup post</category><dc:creator>dsheiner &lt;daniel.s1@gmail.com&gt;</dc:creator></item><item><title>Re: Function Pointer in Class</title><guid isPermaLink="false" /><description>Tom Shelton wrote:&lt;br&gt;&gt; On 2010-02-08, Robert Morley &lt;rmorley@magma.ca.N0.Freak1n.sparn&gt; wrote:&lt;br&gt;&gt;&gt; I'm using Visual C# Express 2008 and I'm trying to implement a function &lt;br&gt;&gt;&gt; pointer as a member of a class.  It sounds like I'm looking for a delegate, &lt;br&gt;&gt;&gt; but I don't quite understand what I need to do.  As you can perhaps guess, &lt;br&gt;&gt;&gt; I'm relatively new to both C# and .NET in general.&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; The relevant function will be a void with no parameters.  My current class &lt;br&gt;&gt;&gt; looks like this:&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; 	public class MenuItem : Object&lt;br&gt;&gt;&gt; 	{&lt;br&gt;&gt;&gt; 		private string name;&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; 		public string Name&lt;br&gt;&gt;&gt; 		{&lt;br&gt;&gt;&gt; 			get { return name; }&lt;br&gt;&gt;&gt; 			set { name = value; }&lt;br&gt;&gt;&gt; 		}&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; 		//public delegate? void FunctionToCall() would go here&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; 		public override string ToString()&lt;br&gt;&gt;&gt; 		{&lt;br&gt;&gt;&gt; 			return Name;&lt;br&gt;&gt;&gt; 		}&lt;br&gt;&gt;&gt; 	}&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; Not very exciting, is it?  There's no constructor because a) This is my &lt;br&gt;&gt;&gt; first class of any significance and I haven't looked up how to do that yet, &lt;br&gt;&gt;&gt; and b) I want the function as part of the constructor if possible, so &lt;br&gt;&gt;&gt; implementation will be dependent on the answer I get in any event. :)&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; The idea is to have an easily-extensible listbox with a variety of functions &lt;br&gt;&gt;&gt; to call and you just double-click on whatever it is you want to do.  When &lt;br&gt;&gt;&gt; MenuItem is instantiated, I would pass in the name of the function to &lt;br&gt;&gt;&gt; execute, like:&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; 	MenuItem mi = new MenuItem("Descriptive Name", MyFunction());&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; Then later in the code, I need to be able to do:&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; 	mi.FunctionToCall();&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; How do I go about doing this?  Or if I'm on the wrong track, how do I do &lt;br&gt;&gt;&gt; something like it?&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; Thanks,&lt;br&gt;&gt;&gt; Rob&lt;br&gt;&gt; &lt;br&gt;&gt; using System;&lt;br&gt;&gt; using System.Windows.Forms;&lt;br&gt;&gt; &lt;br&gt;&gt; namespace WindowsFormsApplication5&lt;br&gt;&gt; {&lt;br&gt;&gt;     public partial class Form1 : Form&lt;br&gt;&gt;     {&lt;br&gt;&gt;         public Form1 ()&lt;br&gt;&gt;         {&lt;br&gt;&gt;             InitializeComponent ();&lt;br&gt;&gt;         }&lt;br&gt;&gt; &lt;br&gt;&gt; &lt;br&gt;&gt;         private void Form1_Load ( object sender, EventArgs e )&lt;br&gt;&gt;         {&lt;br&gt;&gt;             this.listBox1.Items.Add ( new HelloWorldFunction () );&lt;br&gt;&gt;             this.listBox1.Items.Add ( new YouSucketh () );&lt;br&gt;&gt;         }&lt;br&gt;&gt; &lt;br&gt;&gt;         private abstract class FunctionItemBase&lt;br&gt;&gt;         {&lt;br&gt;&gt;             protected FunctionItemBase ( string name, Action function )&lt;br&gt;&gt;             {&lt;br&gt;&gt;                 this.Name = name;&lt;br&gt;&gt;                 this.Function = function;&lt;br&gt;&gt;             }&lt;br&gt;&gt; &lt;br&gt;&gt;             public string Name { get; private set; }&lt;br&gt;&gt;             public Action Function { get; private set; }&lt;br&gt;&gt; &lt;br&gt;&gt;             public override string ToString ()&lt;br&gt;&gt;             {&lt;br&gt;&gt;                 return Name;&lt;br&gt;&gt;             }&lt;br&gt;&gt;         }&lt;br&gt;&gt; &lt;br&gt;&gt; &lt;br&gt;&gt;         private class HelloWorldFunction : FunctionItemBase&lt;br&gt;&gt;         {&lt;br&gt;&gt;             public HelloWorldFunction () : base ( "Hello World!", () =&gt; MessageBox.Show ( "Hello, World!" ) ) { }&lt;br&gt;&gt;         }&lt;br&gt;&gt; &lt;br&gt;&gt;         private class YouSucketh : FunctionItemBase&lt;br&gt;&gt;         {&lt;br&gt;&gt;             public YouSucketh () : base ( "You Sucketh!", () =&gt; MessageBox.Show ( "You Sucketh!" ) ) { }&lt;br&gt;&gt;         }&lt;br&gt;&gt; &lt;br&gt;&gt;         private void listBox1_DoubleClick ( object sender, EventArgs e )&lt;br&gt;&gt;         {&lt;br&gt;&gt;             FunctionItemBase function = listBox1.SelectedItem as FunctionItemBase;&lt;br&gt;&gt;             if ( function != null )&lt;br&gt;&gt;                 function.Function ();&lt;br&gt;&gt;         }&lt;br&gt;&gt; &lt;br&gt;&gt;     }&lt;br&gt;&gt; }&lt;br&gt;&gt; &lt;br&gt;&lt;br&gt;That looks great!  Thanks, Tom.&lt;br&gt;&lt;br&gt;&lt;br&gt;Rob</description><pubDate>Mon, 08 Feb 2010 18:35:09 -0500</pubDate><category>C# newsgroup post</category><dc:creator>Robert Morley &lt;rmorley@magma.ca.N0.Freak1n.sparn&gt;</dc:creator></item><item><title>Re: Function Pointer in Class</title><guid isPermaLink="false" /><description>On 2010-02-08, Robert Morley &lt;rmorley@magma.ca.N0.Freak1n.sparn&gt; wrote:&lt;br&gt;&gt; I'm using Visual C# Express 2008 and I'm trying to implement a function &lt;br&gt;&gt; pointer as a member of a class.  It sounds like I'm looking for a delegate, &lt;br&gt;&gt; but I don't quite understand what I need to do.  As you can perhaps guess, &lt;br&gt;&gt; I'm relatively new to both C# and .NET in general.&lt;br&gt;&gt;&lt;br&gt;&gt; The relevant function will be a void with no parameters.  My current class &lt;br&gt;&gt; looks like this:&lt;br&gt;&gt;&lt;br&gt;&gt; 	public class MenuItem : Object&lt;br&gt;&gt; 	{&lt;br&gt;&gt; 		private string name;&lt;br&gt;&gt;&lt;br&gt;&gt; 		public string Name&lt;br&gt;&gt; 		{&lt;br&gt;&gt; 			get { return name; }&lt;br&gt;&gt; 			set { name = value; }&lt;br&gt;&gt; 		}&lt;br&gt;&gt;&lt;br&gt;&gt; 		//public delegate? void FunctionToCall() would go here&lt;br&gt;&gt;&lt;br&gt;&gt; 		public override string ToString()&lt;br&gt;&gt; 		{&lt;br&gt;&gt; 			return Name;&lt;br&gt;&gt; 		}&lt;br&gt;&gt; 	}&lt;br&gt;&gt;&lt;br&gt;&gt; Not very exciting, is it?  There's no constructor because a) This is my &lt;br&gt;&gt; first class of any significance and I haven't looked up how to do that yet, &lt;br&gt;&gt; and b) I want the function as part of the constructor if possible, so &lt;br&gt;&gt; implementation will be dependent on the answer I get in any event. :)&lt;br&gt;&gt;&lt;br&gt;&gt; The idea is to have an easily-extensible listbox with a variety of functions &lt;br&gt;&gt; to call and you just double-click on whatever it is you want to do.  When &lt;br&gt;&gt; MenuItem is instantiated, I would pass in the name of the function to &lt;br&gt;&gt; execute, like:&lt;br&gt;&gt;&lt;br&gt;&gt; 	MenuItem mi = new MenuItem("Descriptive Name", MyFunction());&lt;br&gt;&gt;&lt;br&gt;&gt; Then later in the code, I need to be able to do:&lt;br&gt;&gt;&lt;br&gt;&gt; 	mi.FunctionToCall();&lt;br&gt;&gt;&lt;br&gt;&gt; How do I go about doing this?  Or if I'm on the wrong track, how do I do &lt;br&gt;&gt; something like it?&lt;br&gt;&gt;&lt;br&gt;&gt;&lt;br&gt;&gt; Thanks,&lt;br&gt;&gt; Rob&lt;br&gt;&lt;br&gt;using System;&lt;br&gt;using System.Windows.Forms;&lt;br&gt;&lt;br&gt;namespace WindowsFormsApplication5&lt;br&gt;{&lt;br&gt;    public partial class Form1 : Form&lt;br&gt;    {&lt;br&gt;        public Form1 ()&lt;br&gt;        {&lt;br&gt;            InitializeComponent ();&lt;br&gt;        }&lt;br&gt;&lt;br&gt;&lt;br&gt;        private void Form1_Load ( object sender, EventArgs e )&lt;br&gt;        {&lt;br&gt;            this.listBox1.Items.Add ( new HelloWorldFunction () );&lt;br&gt;            this.listBox1.Items.Add ( new YouSucketh () );&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        private abstract class FunctionItemBase&lt;br&gt;        {&lt;br&gt;            protected FunctionItemBase ( string name, Action function )&lt;br&gt;            {&lt;br&gt;                this.Name = name;&lt;br&gt;                this.Function = function;&lt;br&gt;            }&lt;br&gt;&lt;br&gt;            public string Name { get; private set; }&lt;br&gt;            public Action Function { get; private set; }&lt;br&gt;&lt;br&gt;            public override string ToString ()&lt;br&gt;            {&lt;br&gt;                return Name;&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;&lt;br&gt;        private class HelloWorldFunction : FunctionItemBase&lt;br&gt;        {&lt;br&gt;            public HelloWorldFunction () : base ( "Hello World!", () =&gt; MessageBox.Show ( "Hello, World!" ) ) { }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        private class YouSucketh : FunctionItemBase&lt;br&gt;        {&lt;br&gt;            public YouSucketh () : base ( "You Sucketh!", () =&gt; MessageBox.Show ( "You Sucketh!" ) ) { }&lt;br&gt;        }&lt;br&gt;&lt;br&gt;        private void listBox1_DoubleClick ( object sender, EventArgs e )&lt;br&gt;        {&lt;br&gt;            FunctionItemBase function = listBox1.SelectedItem as FunctionItemBase;&lt;br&gt;            if ( function != null )&lt;br&gt;                function.Function ();&lt;br&gt;        }&lt;br&gt;&lt;br&gt;    }&lt;br&gt;}&lt;br&gt;&lt;br&gt;-- &lt;br&gt;Tom Shelton</description><pubDate>Mon, 08 Feb 2010 15:29:58 -0800</pubDate><category>C# newsgroup post</category><dc:creator>Tom Shelton &lt;tom_shelton@comcastXXXXXXX.net&gt;</dc:creator></item><item><title>Re: enumerator </title><guid isPermaLink="false" /><description>Tony Johansson wrote:&lt;br&gt;&gt; How can these two examples cause boxing when I use generics with T as string &lt;br&gt;&gt; ???&lt;br&gt;&lt;br&gt;Well, the first causes boxing simply by getting the enumerator. &lt;br&gt;IEnumerable is a reference type (interface) but the implementation is a &lt;br&gt;value type.  Thus, it needs to be boxed.&lt;br&gt;&lt;br&gt;As for the second example, it's because you are calling &lt;br&gt;Console.WriteLine().  Even though the enumerator itself doesn't need &lt;br&gt;boxing, every object enumerated does.&lt;br&gt;&lt;br&gt;&gt; One of the reasons to use generics is just that no boxing/unboxing need to &lt;br&gt;&gt; be made.&lt;br&gt;&lt;br&gt;Console.WriteLine() isn't generic.  How is it going to avoid boxing?&lt;br&gt;&lt;br&gt;&gt; One more question the type that is send to WriteLine is string isn't it so &lt;br&gt;&gt; here is just the ToString used for String because it is overridden ???&lt;br&gt;&lt;br&gt;You didn't call ToString().  You are passing the object and letting the &lt;br&gt;WriteLine() method call ToString().  So the object has to be boxed.&lt;br&gt;&lt;br&gt;&gt; Now the last question if I use MSDN and lookup List&lt;T&gt; this Enumerator is &lt;br&gt;&gt; not there. &lt;br&gt;&lt;br&gt;Yes, it is.&lt;br&gt;&lt;br&gt;&gt; You can look for youself ??&lt;br&gt;&lt;br&gt;You can too:&lt;br&gt;http://msdn.microsoft.com/en-us/library/x854yt9s.aspx&lt;br&gt;&lt;br&gt;Pete</description><pubDate>Mon, 08 Feb 2010 15:20:00 -0800</pubDate><category>C# newsgroup post</category><dc:creator>Peter Duniho &lt;no.peted.spam@no.nwlink.spam.com&gt;</dc:creator></item><item><title>Function Pointer in Class</title><guid isPermaLink="false" /><description>I'm using Visual C# Express 2008 and I'm trying to implement a function &lt;br&gt;pointer as a member of a class.  It sounds like I'm looking for a delegate, &lt;br&gt;but I don't quite understand what I need to do.  As you can perhaps guess, &lt;br&gt;I'm relatively new to both C# and .NET in general.&lt;br&gt;&lt;br&gt;The relevant function will be a void with no parameters.  My current class &lt;br&gt;looks like this:&lt;br&gt;&lt;br&gt;	public class MenuItem : Object&lt;br&gt;	{&lt;br&gt;		private string name;&lt;br&gt;&lt;br&gt;		public string Name&lt;br&gt;		{&lt;br&gt;			get { return name; }&lt;br&gt;			set { name = value; }&lt;br&gt;		}&lt;br&gt;&lt;br&gt;		//public delegate? void FunctionToCall() would go here&lt;br&gt;&lt;br&gt;		public override string ToString()&lt;br&gt;		{&lt;br&gt;			return Name;&lt;br&gt;		}&lt;br&gt;	}&lt;br&gt;&lt;br&gt;Not very exciting, is it?  There's no constructor because a) This is my &lt;br&gt;first class of any significance and I haven't looked up how to do that yet, &lt;br&gt;and b) I want the function as part of the constructor if possible, so &lt;br&gt;implementation will be dependent on the answer I get in any event. :)&lt;br&gt;&lt;br&gt;The idea is to have an easily-extensible listbox with a variety of functions &lt;br&gt;to call and you just double-click on whatever it is you want to do.  When &lt;br&gt;MenuItem is instantiated, I would pass in the name of the function to &lt;br&gt;execute, like:&lt;br&gt;&lt;br&gt;	MenuItem mi = new MenuItem("Descriptive Name", MyFunction());&lt;br&gt;&lt;br&gt;Then later in the code, I need to be able to do:&lt;br&gt;&lt;br&gt;	mi.FunctionToCall();&lt;br&gt;&lt;br&gt;How do I go about doing this?  Or if I'm on the wrong track, how do I do &lt;br&gt;something like it?&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Rob</description><pubDate>Mon, 08 Feb 2010 18:16:38 -0500</pubDate><category>C# newsgroup post</category><dc:creator>Robert Morley &lt;rmorley@magma.ca.N0.Freak1n.sparn&gt;</dc:creator></item><item><title>Re: enumerator </title><guid isPermaLink="false" /><description>&lt;br&gt;"Peter Duniho" &lt;no.peted.spam@no.nwlink.spam.com&gt; skrev i meddelandet &lt;br&gt;news:%23dv2cjOqKHA.5224@TK2MSFTNGP05.phx.gbl...&lt;br&gt;&gt; Tony Johansson wrote:&lt;br&gt;&gt;&gt; Hi!&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; I know I can use the foreach. This is just for understanding.&lt;br&gt;&gt;&gt; My question is if the rows marked with 1 below is doing the exact same &lt;br&gt;&gt;&gt; thing as those that are marked with 2. ?&lt;br&gt;&gt;&lt;br&gt;&gt; Can you be more specific about what you're asking about?&lt;br&gt;&gt;&lt;br&gt;&gt; The two examples definitely do not do the exact same thing.  But, the &lt;br&gt;&gt; extent to which they are different may or may not be important to you. A &lt;br&gt;&gt; couple of examples in particular:&lt;br&gt;&gt;&lt;br&gt;&gt;   &#x16; If you're just using Console.WriteLine(), which takes as the argument &lt;br&gt;&gt; an object reference (that being the overload selected in this example), &lt;br&gt;&gt; then the fact that you get a strongly-typed generic enumerator in the &lt;br&gt;&gt; second example isn't helpful, because the object still winds up boxed.&lt;br&gt;&gt;&lt;br&gt;&gt;   &#x16; In the first example, the enumerator instance itself winds up boxed &lt;br&gt;&gt; (List&lt;T&gt;.Enumerator is a value type), which may or may not be important to &lt;br&gt;&gt; you.&lt;br&gt;&gt;&lt;br&gt;&gt; As for your later question about finding the type in the documentation, &lt;br&gt;&gt; I'm not sure why you were unable to find the type, but it's clearly a &lt;br&gt;&gt; nested type in List&lt;T&gt;, so you should be able to find it easily just by &lt;br&gt;&gt; looking at the documentation for List&lt;T&gt;.&lt;br&gt;&gt;&lt;br&gt;&gt; Pete&lt;br&gt;&lt;br&gt;How can these two examples cause boxing when I use generics with T as string &lt;br&gt;???&lt;br&gt;One of the reasons to use generics is just that no boxing/unboxing need to &lt;br&gt;be made.&lt;br&gt;One more question the type that is send to WriteLine is string isn't it so &lt;br&gt;here is just the ToString used for String because it is overridden ???&lt;br&gt;&lt;br&gt;Now the last question if I use MSDN and lookup List&lt;T&gt; this Enumerator is &lt;br&gt;not there. You can look for youself ??&lt;br&gt;&lt;br&gt;//Tony &lt;br&gt;&lt;br&gt;</description><pubDate>Mon, 8 Feb 2010 23:56:53 +0100</pubDate><category>C# newsgroup post</category><dc:creator>"Tony Johansson" &lt;johansson.andersson@telia.com&gt;</dc:creator></item><item><title>Re: WPF - Gantt Chart</title><guid isPermaLink="false" /><description>kazik wrote:&lt;br&gt;&gt; hi,&lt;br&gt;&gt; &lt;br&gt;&gt; do you know, where I can find free Gantt Chart WPF libraries? I can only &lt;br&gt;&gt; find trial versions.&lt;br&gt;&lt;br&gt;What features are you looking for?  It seems to me that, to implement a &lt;br&gt;basic Gantt chart, it should not take you very long just to write it &lt;br&gt;yourself, if you find the available third-party libraries outside your &lt;br&gt;budget.&lt;br&gt;&lt;br&gt;Keeping in mind, of course, the need to balance the cost of your own &lt;br&gt;time against the cost of the library.  Frankly, for all but the most &lt;br&gt;ridiculously over-priced library, if you actually need the feature set &lt;br&gt;of the library, you're unlikely to be able to develop a one-off solution &lt;br&gt;at lower cost than simply licensing a library.&lt;br&gt;&lt;br&gt;Pete</description><pubDate>Mon, 08 Feb 2010 12:26:15 -0800</pubDate><category>C# newsgroup post</category><dc:creator>Peter Duniho &lt;no.peted.spam@no.nwlink.spam.com&gt;</dc:creator></item><item><title>WPF - Gantt Chart</title><guid isPermaLink="false" /><description>hi,&lt;br&gt;&lt;br&gt;do you know, where I can find free Gantt Chart WPF libraries? I can only &lt;br&gt;find trial versions.&lt;br&gt;&lt;br&gt;regards&lt;br&gt;daniel</description><pubDate>Mon, 08 Feb 2010 21:08:08 +0100</pubDate><category>C# newsgroup post</category><dc:creator>kazik &lt;kazik79@o2.pl&gt;</dc:creator></item><item><title>Re: VS2008 *.reg file</title><guid isPermaLink="false" /><description>I specified as post build event (to be run on successful completion) as &lt;br&gt;&lt;br&gt;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm &lt;br&gt;$(TargetDir)\$(TargetFileName) codebase /regfile:$(TargetDir)\mydll.reg&lt;br&gt;&lt;br&gt;It worked! Thanks for the hint.&lt;br&gt;</description><pubDate>Mon, 8 Feb 2010 11:46:01 -0800</pubDate><category>C# newsgroup post</category><dc:creator>=?Utf-8?B?QUEyZTcyRQ==?= &lt;AA2e72E@discussions.microsoft.com&gt;</dc:creator></item><item><title>Re: VS2008 *.reg file</title><guid isPermaLink="false" /><description>AA2e72E wrote:&lt;br&gt;&gt; regsvr32? &lt;br&gt;&gt; &lt;br&gt;&gt; My experience is that you need to use &lt;br&gt;&gt; &lt;br&gt;&gt; regasm my.dll /codebase&lt;br&gt;&gt; &lt;br&gt;&gt; for the DLL (I did say COM Interop) to be available as a server.&lt;br&gt;&lt;br&gt;That's fine.  It's basically the same idea as regsvr32.  The point being &lt;br&gt;that you can register the DLL without dealing with a .reg file.&lt;br&gt;&lt;br&gt;If you want to use regasm to register your DLL, just do that as part of &lt;br&gt;your deployment.&lt;br&gt;&lt;br&gt;Pete</description><pubDate>Mon, 08 Feb 2010 11:30:32 -0800</pubDate><category>C# newsgroup post</category><dc:creator>Peter Duniho &lt;no.peted.spam@no.nwlink.spam.com&gt;</dc:creator></item><item><title>Re: Expressions and their side effects</title><guid isPermaLink="false" /><description>trubar a wrote:&lt;br&gt;&gt; I assume that in math expressions are interpreted a bit differently?&lt;br&gt;&gt; In other words, in math we would consider a variable x being assigned&lt;br&gt;&gt; a value of "10" as being the main effect of the expression "x=10"?!&lt;br&gt;&lt;br&gt;You can "consider" it as whatever you like.  There is no concept of &lt;br&gt;"side-effect" in traditional math (though of course, mathematics &lt;br&gt;applying to algorithms would tend to use the same definition as found in &lt;br&gt;computer science), so how you describe the algebraic formula in math has &lt;br&gt;no relevance to the broader question.&lt;br&gt;&lt;br&gt;I will point out, however, that in mathematics the = symbol is not an &lt;br&gt;assignment operator.  It's a description of an _existing_ relationship &lt;br&gt;between the two sides of the formula.  There's no "effect" at all, main &lt;br&gt;or otherwise.&lt;br&gt;&lt;br&gt;&gt; b)&lt;br&gt;&gt;&gt; But, the result is also not "x".  The result of the expression in that&lt;br&gt;&gt;&gt; case is "10", regardless of the value in "x"&lt;br&gt;&gt;&gt;&lt;br&gt;&gt;&gt; The result of an expression is a value.&lt;br&gt;&gt; &lt;br&gt;&gt; I also assume that in math the result of the expression &#x13;x=10&#x14;&lt;br&gt;&gt; wouldn&#x12;t be a value of &#x13;10&#x14; ( in other words, in math our expression&lt;br&gt;&gt; doesn&#x12;t &#x13;return&#x14; any values ) ? Thus, in math the result of expression&lt;br&gt;&gt; would either be x getting assigned a value or we could perhaps even&lt;br&gt;&gt; claim that our expression doesn&#x12;t have a result?!&lt;br&gt;&lt;br&gt;See above.  "In math", the question you are asking doesn't even make sense.&lt;br&gt;&lt;br&gt;&gt; c)&lt;br&gt;&gt;&gt; understand that when you write "x = 10", that's an expression, and it&lt;br&gt;&gt;&gt; returns a value, rather than itself).&lt;br&gt;&gt; &lt;br&gt;&gt; So returned value (10) is no longer an expression, but just its&lt;br&gt;&gt; result?&lt;br&gt;&lt;br&gt;In programming, expressions are what you write in code.  They are part f &lt;br&gt;the static program description.  The value returned by an expression is &lt;br&gt;something else entirely.  It's what an expression in code causes to &lt;br&gt;happen when the code is actually executed.&lt;br&gt;&lt;br&gt;So, yes&#x5;it's trivially true that the "returned value is no longer an &lt;br&gt;expression", since the expression only has a value at execution time as &lt;br&gt;a consequence of evaluating it.&lt;br&gt;&lt;br&gt;Pete</description><pubDate>Mon, 08 Feb 2010 11:26:30 -0800</pubDate><category>C# newsgroup post</category><dc:creator>Peter Duniho &lt;no.peted.spam@no.nwlink.spam.com&gt;</dc:creator></item><item><title>Re: VS2008 *.reg file</title><guid isPermaLink="false" /><description>Thanks for the hint Konrad. &lt;br&gt;&lt;br&gt;I've never used build events: it is time for me to learn how to use them.&lt;br&gt;&lt;br&gt;"Konrad Neitzel" wrote:&lt;br&gt;&lt;br&gt;&gt; Hi!&lt;br&gt;&gt; &lt;br&gt;&gt; &lt;br&gt;&gt; "AA2e72E" &lt;AA2e72E@discussions.microsoft.com&gt; wrote in message &lt;br&gt;&gt; news:D4C493A0-5F29-48E4-8774-7EDBF3BD0B82@microsoft.com...&lt;br&gt;&gt; &lt;br&gt;&gt; &gt; regasm my.dll /codebase /regfile:mydll.reg&lt;br&gt;&gt; &lt;br&gt;&gt; &gt; I was hoping for a way to get VS2008 to create the mydll.reg file, perhaps&lt;br&gt;&gt; &gt; in the release folder.&lt;br&gt;&gt; &lt;br&gt;&gt; Just check the Build Events options of your project. Did you try to run that &lt;br&gt;&gt; command in the "Post-build event command line"?&lt;br&gt;&gt; &lt;br&gt;&gt; That way I would add special commands that I want the System to do &lt;br&gt;&gt; automatically inside the build. And through "Edit Post-build ..." button you &lt;br&gt;&gt; get access to the Macros (which are simply a set of predefined variables).&lt;br&gt;&gt; &lt;br&gt;&gt; Hope this helps a little.&lt;br&gt;&gt; &lt;br&gt;&gt; Konrad &lt;br&gt;&gt; </description><pubDate>Mon, 8 Feb 2010 11:18:03 -0800</pubDate><category>C# newsgroup post</category><dc:creator>=?Utf-8?B?QUEyZTcyRQ==?= &lt;AA2e72E@discussions.microsoft.com&gt;</dc:creator></item><item><title>Re: VS2008 *.reg file</title><guid isPermaLink="false" /><description>Hi!&lt;br&gt;&lt;br&gt;&lt;br&gt;"AA2e72E" &lt;AA2e72E@discussions.microsoft.com&gt; wrote in message &lt;br&gt;news:D4C493A0-5F29-48E4-8774-7EDBF3BD0B82@microsoft.com...&lt;br&gt;&lt;br&gt;&gt; regasm my.dll /codebase /regfile:mydll.reg&lt;br&gt;&lt;br&gt;&gt; I was hoping for a way to get VS2008 to create the mydll.reg file, perhaps&lt;br&gt;&gt; in the release folder.&lt;br&gt;&lt;br&gt;Just check the Build Events options of your project. Did you try to run that &lt;br&gt;command in the "Post-build event command line"?&lt;br&gt;&lt;br&gt;That way I would add special commands that I want the System to do &lt;br&gt;automatically inside the build. And through "Edit Post-build ..." button you &lt;br&gt;get access to the Macros (which are simply a set of predefined variables).&lt;br&gt;&lt;br&gt;Hope this helps a little.&lt;br&gt;&lt;br&gt;Konrad &lt;br&gt;</description><pubDate>Mon, 8 Feb 2010 20:02:23 +0100</pubDate><category>C# newsgroup post</category><dc:creator>"Konrad Neitzel" &lt;neitzel@neitzel.de&gt;</dc:creator></item><item><title>Re: Expressions and their side effects</title><guid isPermaLink="false" /><description>hi&lt;br&gt;&lt;br&gt;On Feb 7, 11:34=A0pm, Peter Duniho &lt;no.peted.s...@no.nwlink.spam.com&gt;&lt;br&gt;wrote:&lt;br&gt;&gt; trubar a wrote:&lt;br&gt;&gt; &gt;&lt;br&gt;&gt;&lt;br&gt;&lt;br&gt;a)&lt;br&gt;&gt; The result of an expression is a value.  So "x =3D 10" cannot&lt;br&gt;&gt; be the result of the expression (*).&lt;br&gt;&gt;&lt;br&gt;&gt; But, the result is also not "x".  The result of the expression in that&lt;br&gt;&gt; case is "10", regardless of the value in "x".&lt;br&gt;&gt;&lt;br&gt;&gt; The result of the expression (expressions always have&lt;br&gt;&gt; a result) is simply thrown away&lt;br&gt;&gt;&lt;br&gt;&gt; The result of an expression is a value.&lt;br&gt;&lt;br&gt;I assume that in math expressions are interpreted a bit differently?&lt;br&gt;In other words, in math we would consider a variable x being assigned&lt;br&gt;a value of "10" as being the main effect of the expression "x=3D10"?!&lt;br&gt;&lt;br&gt;b)&lt;br&gt;&gt; But, the result is also not "x".  The result of the expression in that&lt;br&gt;&gt; case is "10", regardless of the value in "x"&lt;br&gt;&gt;&lt;br&gt;&gt; The result of an expression is a value.&lt;br&gt;&lt;br&gt;I also assume that in math the result of the expression =93x=3D10=94&lt;br&gt;wouldn=92t be a value of =9310=94 ( in other words, in math our expression&lt;br&gt;doesn=92t =93return=94 any values ) ? Thus, in math the result of expressio=&lt;br&gt;n&lt;br&gt;would either be x getting assigned a value or we could perhaps even&lt;br&gt;claim that our expression doesn=92t have a result?!&lt;br&gt;&lt;br&gt;c)&lt;br&gt;&gt; understand that when you write "x =3D 10", that's an expression, and it&lt;br&gt;&gt; returns a value, rather than itself).&lt;br&gt;&lt;br&gt;So returned value (10) is no longer an expression, but just its&lt;br&gt;result?&lt;br&gt;&lt;br&gt;&lt;br&gt;thank you</description><pubDate>Mon, 8 Feb 2010 10:58:48 -0800 (PST)</pubDate><category>C# newsgroup post</category><dc:creator>trubar a &lt;asponmynet@gmail.com&gt;</dc:creator></item><item><title>Re: Supporting two executables in a solution</title><guid isPermaLink="false" /><description>On Feb 6, 2:47 pm, "Morris" &lt;imor...@automail.com&gt; wrote:&lt;br&gt;&gt; &gt; There's no need to add the dynamically launched EXE as a reference, nor&lt;br&gt;&gt; &gt; would doing so help.  For the Process class, you'll need the EXE to exist&lt;br&gt;&gt; &gt; as a file at a known location (e.g. in the same directory with the main&lt;br&gt;&gt; &gt; program), and pass that file path to the Process class.&lt;br&gt;&gt;&lt;br&gt;&gt; &gt; Pete&lt;br&gt;&gt;&lt;br&gt;&gt; Dear Pete,&lt;br&gt;&gt; Though there is no need I still think that it may be convinient to add it&lt;br&gt;&gt; because I may need to modify the second executable along the solution&lt;br&gt;&gt; development life time, as would be with any dll in the solution.&lt;br&gt;&gt; Is it posible?&lt;br&gt;&gt; Regards&lt;br&gt;&gt; Morris&lt;br&gt;&lt;br&gt;You can have both projects in the same solution, if that's what you&lt;br&gt;mean.&lt;br&gt;&lt;br&gt;Chris</description><pubDate>Mon, 8 Feb 2010 10:51:22 -0800 (PST)</pubDate><category>C# newsgroup post</category><dc:creator>Chris Dunaway &lt;dunawayc@gmail.com&gt;</dc:creator></item><item><title>Re: VS2008 *.reg file</title><guid isPermaLink="false" /><description>regsvr32? &lt;br&gt;&lt;br&gt;My experience is that you need to use &lt;br&gt;&lt;br&gt;regasm my.dll /codebase&lt;br&gt;&lt;br&gt;for the DLL (I did say COM Interop) to be available as a server.&lt;br&gt;&lt;br&gt;There is an option to acquire the *.reg file with&lt;br&gt;&lt;br&gt;regasm my.dll /codebase /regfile:mydll.reg&lt;br&gt;&lt;br&gt;I was hoping for a way to get VS2008 to create the mydll.reg file, perhaps &lt;br&gt;in the release folder.&lt;br&gt;&lt;br&gt;&lt;br&gt;"Peter Duniho" wrote:&lt;br&gt;&lt;br&gt;&gt; AA2e72E wrote:&lt;br&gt;&gt; &gt; Is there a way to make VS2008 create a *.reg file when compiling a COM &lt;br&gt;&gt; &gt; Interrop DLL?&lt;br&gt;&gt; &lt;br&gt;&gt; Not as far as I know.&lt;br&gt;&gt; &lt;br&gt;&gt; &gt; The compilation process creates the *.DLL file and registers it: it would be &lt;br&gt;&gt; &gt; useful to have the *.reg file to see the chanhes it makes to the Registry as &lt;br&gt;&gt; &gt; well as for deployment purposes.&lt;br&gt;&gt; &lt;br&gt;&gt; The DLL can self-register with regsvr32.  You shouldn't need a .reg file &lt;br&gt;&gt; to register the DLL during deployment.&lt;br&gt;&gt; &lt;br&gt;&gt; Pete&lt;br&gt;&gt; .&lt;br&gt;&gt; </description><pubDate>Mon, 8 Feb 2010 10:42:01 -0800</pubDate><category>C# newsgroup post</category><dc:creator>=?Utf-8?B?QUEyZTcyRQ==?= &lt;AA2e72E@discussions.microsoft.com&gt;</dc:creator></item><item><title>Re: Is there an escape sequence for Space char?  for space delimte</title><guid isPermaLink="false" /><description>"Rich" &lt;Rich@discussions.microsoft.com&gt; wrote in message &lt;br&gt;news:CBB30EFA-1E46-4180-B969-90E134B44C5E@microsoft.com...&lt;br&gt;&lt;br&gt;&gt; Yay!  I got it work -- turns out that my text file with the 52000 rows was&lt;br&gt;&gt; this type:&lt;br&gt;&gt;&lt;br&gt;&gt; "abc" "def" "ghi" "jkl"&lt;br&gt;&gt; "abc" "def" "ghi" "jkl"&lt;br&gt;&gt; "abc" "def" "ghi" "jkl"&lt;br&gt;&gt; ...&lt;br&gt;&gt;&lt;br&gt;&gt; with double quotes surrounding the text.  It must have been generated with&lt;br&gt;&gt; VBA.  Anyway, the streamreader in my original routine will read the double&lt;br&gt;&gt; quotes OK, I was just doing a .Replace(..."\"","") for each piece of data.&lt;br&gt;&gt; Once I understand the workings of GenericParser I could probably add a&lt;br&gt;&gt; .Replace to it (somewhere).&lt;br&gt;&lt;br&gt;parser.TextQualifier = '"' // &lt;-- apostrophe quotation-mark apostrophe &lt;br&gt;&lt;br&gt;</description><pubDate>Mon, 8 Feb 2010 13:40:03 -0500</pubDate><category>C# newsgroup post</category><dc:creator>"Jeff Johnson" &lt;i.get@enough.spam&gt;</dc:creator></item></channel></rss>