Geeks With Blogs
Rohit Gupta Engaging talk on Microsoft Technologies ....My Resume
October 2008 Entries
Linq To XML : Check for existence of element
var bookQuery = from book in bookXml.Descendants("Item") let attributes = book.Element("ItemAttributes") let price = Decimal.Parse(( book.Elements("OfferSummary... && book.Element("OfferSummary"... ? book.Element("OfferSummary") .Element("LowestNewPrice") .Element("Amount").Value : (attributes.Elements("ListP... ? attributes.Element("ListPri... : "0"))) / 100 select new {Price = price}; Elements(“node”).Any() does the trick. ......

Posted On Monday, October 13, 2008 4:33 PM

Method Hiding... Polymorphism in C#
In the following code: interface IBand { int ID {get;set;} string Name {get;set;} void GetStatus(); } public class Band : IBand { public int ID { get; set; } public string Name { get; set; } public Band() { GetStatus(); } public void GetStatus() { ID = 555; Name = "Ring"; Console.WriteLine("Base Class Called"); } } public class ABand : Band, IBand { public string Update { get; set; } public ABand() : base() {} public new void GetStatus() { ID = 655; Name = "TEsst"; Update = "ddd"; Console.WriteLine("Derived ......

Posted On Monday, October 13, 2008 4:24 PM

Passing state to threads via anonymous calls
We already know that we can pass state into to Threads in 2 ways: 1. using ParameterizedThreadStart delegate 2.using global variables(reference or value types) accessible to the main thread as well the instantiated thread. This is also the way to share data amonst multiple threads. Infact the most common way to share data between threads is using static variables where application wide scope is desired. 3.using Thread.QueueUserWorkItem ... This differs from Parameterized ThreadStart delegate since ......

Posted On Monday, October 13, 2008 3:19 PM

Copyright © Rohit Gupta | Powered by: GeeksWithBlogs.net