Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Extension method doesn't fit in this scenerio? Pin
stancrm14-Jul-08 19:36
stancrm14-Jul-08 19:36 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 19:40
Michael Sync14-Jul-08 19:40 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
stancrm14-Jul-08 19:42
stancrm14-Jul-08 19:42 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 19:46
Michael Sync14-Jul-08 19:46 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 19:56
Michael Sync14-Jul-08 19:56 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
leppie14-Jul-08 22:22
leppie14-Jul-08 22:22 
AnswerRe: C# Extension method doesn't fit in this scenerio? Pin
J4amieC14-Jul-08 21:56
J4amieC14-Jul-08 21:56 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 22:06
Michael Sync14-Jul-08 22:06 
J4amieC wrote:
myList.Sort("myField DESC") and it shows up in intellisense.


Yes. because "myList" is an object.

For example:

I have an extension method like that.

namespace SilverlightHelpers.Helpers {
    //Silverlight - Array Class: http://msdn.microsoft.com/en-us/library/system.array_members(VS.95).aspx
    //.NET - Array Class: http://msdn.microsoft.com/en-us/library/system.array_members.aspx
    public static class ArrayHelper {
        public static T Find<t>(this Array ary,
                                T[] array,
                                Predicate<t> match) {

            foreach (var o in array) {
                if (match(o)) {
                    return o;
                }
            }

            return default(T);
        }
}
}</t></t>



if I use like Array.Find, it won't work.

but if I use like

Point[] points = { new Point(100, 200), 
            new Point(150, 250), new Point(250, 375), 
            new Point(275, 395), new Point(295, 450) };


points.Find  << It will work. 


Please correct me if I'm wrong..



Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)


GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 22:07
Michael Sync14-Jul-08 22:07 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
J4amieC14-Jul-08 22:09
J4amieC14-Jul-08 22:09 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 22:17
Michael Sync14-Jul-08 22:17 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
leppie14-Jul-08 22:24
leppie14-Jul-08 22:24 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 22:34
Michael Sync14-Jul-08 22:34 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
DaveyM6914-Jul-08 23:11
professionalDaveyM6914-Jul-08 23:11 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync14-Jul-08 23:22
Michael Sync14-Jul-08 23:22 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
DaveyM6914-Jul-08 23:32
professionalDaveyM6914-Jul-08 23:32 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync15-Jul-08 3:37
Michael Sync15-Jul-08 3:37 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Scott Dorman15-Jul-08 2:31
professionalScott Dorman15-Jul-08 2:31 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
DaveyM6915-Jul-08 3:32
professionalDaveyM6915-Jul-08 3:32 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Michael Sync15-Jul-08 3:36
Michael Sync15-Jul-08 3:36 
GeneralRe: C# Extension method doesn't fit in this scenerio? Pin
Scott Dorman15-Jul-08 5:30
professionalScott Dorman15-Jul-08 5:30 
AnswerRe: C# Extension method doesn't fit in this scenerio? Pin
Scott Dorman15-Jul-08 2:21
professionalScott Dorman15-Jul-08 2:21 
QuestionAnnotations method ? Pin
Mohammad Dayyan14-Jul-08 14:50
Mohammad Dayyan14-Jul-08 14:50 
QuestiontableLayoutPanel cells Pin
nelsonpaixao14-Jul-08 13:26
nelsonpaixao14-Jul-08 13:26 
AnswerRe: tableLayoutPanel cells Pin
stancrm14-Jul-08 19:39
stancrm14-Jul-08 19:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.