Saturday, November 3, 2012

Starting a blog Series on C# 2.0 to 5.0

During next few days i will be talking about the below given features of C Sharp

Code is available on codeplex on this URL

http://csharp2andabove.codeplex.com/

C# 2.0

  • Partial class
  • Partial methods
  • Generics
  • Nullable types
  • yield keyword
  • anonymous methods (the delegate keyword)
  • null coalescing operator (??)

C# 3.0
  • Auto Implemented properties
  • Lambada
  • object initializes Collection initializes
  • Anonymous Types
  • Var
  • Extension Methods
  • LINQ

C# 4.0
  • Dynamic word
  • Covariant and contravariant generic type parameters
  • Optional Parameters and Named Arguments
  • Tuples
  • Task Parallel Library


C# 5.0
  • Async
  • Await

Generics
  •  Advance Generics 1 {Classes , Func}
  • Advance Generics 2 {Action , Predicate}

Tuesday, March 13, 2012

Is really visible JQuery Selector

Sometimes you will face a challange with jQuery Selectors that a DOM element is really visible or not.
Lets take following example

A Parent div is hidden and there is a txtname inside it which is not visible to the viewer as its parent div is not visible and based on this you need to take a action
so now you can use this extender selector to find out this is really visible or not




$.extend(
$.expr[":"],
{
reallyhidden: function (a) {
var obj = $(a);
while ((obj.css(“visibility”) == “inherit” && obj.css(“display”) != “none”) && obj.parent()) {
obj = obj.parent();
}
return (obj.css(“visibility”) == “hidden” || obj.css(‘display’) == ‘none’);
}
}
);
$(document).ready(function()
{
if($(‘#something’).is(‘:reallyhidden’)){

alert(‘yes’);
$(‘#something’).parent().show();
}
else{
alert(‘no’);
}
});

There was an error in this gadget