Bob and Chris Road Show Notes

A rambling assemblage of presentation notes follows…

VS2008 Presentation

  • Use 2 versions of the .SLN if you want to be compatible between VS2005 and VS2008.
  • Ctrl-. for adding Using statement
  • Ctrl-P for intellisense dropdown transparency
  • CSS tools are shared with Expression Blend
  • Target Rule style dropdown on the currently selected HTML
  • Can drag and drop CSS styles from page.css to shared .css stylesheet
  • Inline display w/ float left disables <Br/> in photo list.  Dragged grid item boundaries to increase image spacing.  Style auto-added to item’s Target Rule.
  • Javascript Intellisense.  Var Div1 = doc.getElID().  Div1.<-Intellisense!
  • Drag and Drop .JS script referencing w/ Intellisense to .JS functions
  • .JS Comment annotation used with Intellisense.  Also intellisense on return type.
  • Intellisense with Ajax Toolkit Libraries: $functions, Sys.Net…
  • To support JS debugging, undisable Script Debugging in IE (Advanced Panel)
  • Check out Chris’s Expression-VS2008 functions slide when available.
  • “Crossbow” – Windows Forms and WPF to coexist

 

LINQ

  • Type inferencing – Customer c = … var c = …
  • Object Initializers – Invoice I = new Invoice { custID = 11, Name = “Smith” };
  • Anonymous Types – var i = new {custID = 123, Name = “Smith” };  var i = new {123, “Smith”};
  • Extension Methods – Extends existing types.  Static, Public, housed in Static Class
  • Lambda Expressions – Based on Anonymous Methods.  n => n + 1;  In LINQ, Predicates and Projectors.  Predicate: (p) => p.Gender == “F”.  Projector: (p) => p.Gender ? “F” : “Female”;
  • Query Expressions – From _ In _ join _ In _ on _ equals _ let _ = _ where _ orderby _ select _ group
  • public string { get; set; };
  • Collection Initializers – var a = new List<string> { “one”, “two” };  var d = new List<Beer> { new Beer { name = “..”, ABV = 5.4 }, new Beer {..};
  • Extension Method – beer1.Drink() – public static void Drink(this Beer b){}
  • Lambda – return beer1.FindAll(b => b.ADV > abv )
  • IEnumerable <string>age = names
      .Where(s => s[0] = ‘A’) – Example of Extension Method, fires when evaluating query, not when declaring the query
  • New Extensions Methods on Collections – a.Take(2).ToList().ForEach(Console.WriteLine);  cool
  • Grouping – a.Intersection, a.ToList, a.Excerpt, a.Distinct, a.Union
  • (from b in beers1 select b.name).Distinct();
  • LINQ Samples: http://tinyurl.com/ymmyr7

 

LINQ to SQL

  • ORM Designer, CRUD definitions
  • Same idea as ADO DataAdaptor – storing changes and applying to database
  • DataContext Class
  • Drag and Drop tables onto designer.  Creates new Data Context classes
  • PhotoAlbumDataContest db = new  PhotoAlbumDataContext();  var results = from a in db.albums
  • New VS2008 ListView control.  <%#Eval(Count) %>
  • XML Literals (VB).  For C#, PmeXmLAXLinqX…. Scott Hanselman

Article written by

A long time developer, I was an early adopter of Linux in the mid-90's for a few years until I entered corporate environments and worked with Microsoft technologies like ASP, then .NET. In 2008 I released Sueetie, an Online Community Platform built in .NET. In late 2012 I returned to my Linux roots and locked in on Java development. Much of my work is available on GitHub.