Hands-on Labs of Reactive Extensions for .NET (Rx) doesn't work

问题 Hands-on Labs of Reactive Extensions for .NET (Rx) doesn't work

  • 2011年7月7日 11:43
     
      包含代码

    Hi,

    I am using the Hands-on Labs of Reactive Extensions for .NET (Rx) PDF.

    Most of the examples are not working anymore.

    I'm getting some weird kind of errors.

    Till Excersie 2, However I made it work.

    But from Exercise 3 – Importing .NET events into Rx, it's not working anymore.

     

    Say for the below example,

     

         var lbl = new Label(); 
         var frm = new Form { Controls = { lbl } };
    
         frm.MouseMove += (sender, args) =>
         {
           lbl.Text = args.Location.ToString();
         };
    
         Application.Run(frm);

    The Error it's giving is :

    Error 1 A local variable named 'args' cannot be declared in this scope because it would give a different meaning to 'args', which is already used in a 'parent or current' scope to denote something else C:\My Documents\Visual Studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.cs 15 37 ConsoleApplication1

    And for the rest of the examples, this kind of more errors are going on.
    Any help?

     


    Thanks & Regards, Naimish Pandya [MCTS, MCPD] http://naimishpandya.wordpress.com/

全部回复

  • 2011年10月4日 5:45
     
     
    No reply still??
    Thanks & Regards, Naimish Pandya [MCTS, MCPD, MVP] http://naimishpandya.wordpress.com/
  • 2011年10月4日 6:26
     
      包含代码

    Hi Naimish,

    I don't think you read the instructions carefully enough. The default `Program.cs` is replaced by the following code:

    using System.Linq;
    using System.Windows.Forms;
    
    class Program
    {
        static void Main()
        {
            var lbl = new Label();
            var frm = new Form
            {
                Controls = { lbl }
            };
    
            frm.MouseMove += (sender, args) =>
            {
                lbl.Text = args.Location.ToString();  // This has become a position-tracking label. 
            };
    
            Application.Run(frm); 
        }
    }
    


    In this code there is only one `args` so the code compiles.

    Cheers.


    James C-S
  • 2012年4月26日 8:25
     
     

    I've started working through the lab using Rx v1.0 but the document seems to be out of date, e.g. System.CoreEx no longer exists, and methods such as subscriber.Run and Observable.GenerateWithTime have disappeared. I don't see any point in proceeding with the lab if these problems are going to hinder my attempts at learning.

    Is there an updated version anywhere, or can someone recommend a good Rx tutorial?

    Thanks in advance

    Andy

  • 2012年4月27日 5:16
    所有者:
     
     
    We will update documentation in the Rx v2.0 timeframe. Thanks for reminding us and sorry for the inconvenience!

    using (Microsoft.Sql.Cloud.DataProgrammability.Rx) { Signature.Emit("Bart De Smet"); }

  • 2012年6月19日 22:10
     
     
    I assume that DEVHOL203 will be updated to actually work with the nuget libraries.

    It is really frustrating to want to ramp up on a technology when examples, documentation, etc. are all over the place.