Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
GeneralRe: Windows form controls reposition when DPI changes Pin
robwm116-Dec-14 11:46
robwm116-Dec-14 11:46 
GeneralRe: Windows form controls reposition when DPI changes Pin
Eddy Vluggen17-Dec-14 0:27
professionalEddy Vluggen17-Dec-14 0:27 
QuestionBitmap Dispose Pin
V.12-Dec-14 2:26
professionalV.12-Dec-14 2:26 
AnswerRe: Bitmap Dispose Pin
Marc Clifton12-Dec-14 3:11
mvaMarc Clifton12-Dec-14 3:11 
AnswerRe: Bitmap Dispose Pin
OriginalGriff12-Dec-14 3:55
mveOriginalGriff12-Dec-14 3:55 
AnswerRe: Bitmap Dispose Pin
Richard Andrew x6412-Dec-14 7:20
professionalRichard Andrew x6412-Dec-14 7:20 
GeneralRe: Bitmap Dispose Pin
OriginalGriff12-Dec-14 8:14
mveOriginalGriff12-Dec-14 8:14 
GeneralRe: Bitmap Dispose Pin
Richard Andrew x6412-Dec-14 8:16
professionalRichard Andrew x6412-Dec-14 8:16 
QuestionRe: Bitmap Dispose Pin
Richard Andrew x6412-Dec-14 8:31
professionalRichard Andrew x6412-Dec-14 8:31 
AnswerRe: Bitmap Dispose Pin
OriginalGriff13-Dec-14 0:19
mveOriginalGriff13-Dec-14 0:19 
GeneralRe: Bitmap Dispose Pin
Richard Deeming15-Dec-14 2:15
mveRichard Deeming15-Dec-14 2:15 
GeneralRe: Bitmap Dispose Pin
OriginalGriff15-Dec-14 2:27
mveOriginalGriff15-Dec-14 2:27 
GeneralRe: Bitmap Dispose Pin
Richard Deeming12-Dec-14 8:56
mveRichard Deeming12-Dec-14 8:56 
GeneralRe: Bitmap Dispose Pin
V.13-Dec-14 6:26
professionalV.13-Dec-14 6:26 
Questionconsle application Pin
Kasi .A12-Dec-14 0:52
Kasi .A12-Dec-14 0:52 
AnswerRe: consle application Pin
RUs12312-Dec-14 0:57
RUs12312-Dec-14 0:57 
Suggestion[REPOST] consle application Pin
Richard Deeming12-Dec-14 1:40
mveRichard Deeming12-Dec-14 1:40 
AnswerRe: consle application Pin
Eddy Vluggen12-Dec-14 7:47
professionalEddy Vluggen12-Dec-14 7:47 
QuestionExtension method for a list Pin
Frank W. Wu11-Dec-14 4:34
Frank W. Wu11-Dec-14 4:34 
SuggestionRe: Extension method for a list Pin
Kornfeld Eliyahu Peter11-Dec-14 4:48
professionalKornfeld Eliyahu Peter11-Dec-14 4:48 
AnswerRe: Extension method for a list Pin
SledgeHammer0111-Dec-14 4:57
SledgeHammer0111-Dec-14 4:57 
GeneralRe: Extension method for a list Pin
Richard Deeming11-Dec-14 5:06
mveRichard Deeming11-Dec-14 5:06 
GeneralRe: Extension method for a list Pin
SledgeHammer0111-Dec-14 5:15
SledgeHammer0111-Dec-14 5:15 
AnswerRe: Extension method for a list Pin
BillWoodruff11-Dec-14 5:14
professionalBillWoodruff11-Dec-14 5:14 
Interesting, I can't reproduce your compile error in FrameWork 4.5.1. I note the apparently strange fact that you are not assigning the result of the call to 'GetModified to any variable, so the result goes into outer-space.

This works for me:
C#
public static class Extensions
{
    public static List<Foo> GetModified(this List<Foo> list)
    {
        if ((list == null) || (list.Count == 0)) return null;

        return list.Where(r => r.GetThisFooDirty()).ToList();
    }
}

public class Foo
{
    public string Name { private set; get; }

    private bool ThisFooIsDirty { set; get; }

    public bool GetThisFooDirty() { return ThisFooIsDirty; }

    public void SetThisFooDirty(bool dirtyness) { ThisFooIsDirty = dirtyness; }

    public Foo(string fooName)
    {
        Name = fooName;
        ThisFooIsDirty = false;
    }
}
Test:
C#
List<Foo> fooList = new List<Foo>
{
    new Foo("foo1"),
    new Foo("Foo2"),
    new Foo("Foo3")
};

fooList[1].SetThisFooDirty(true);
fooList[2].SetThisFooDirty(true);

var whoIsDirty = fooList.GetModified();
Now, I'm going to go wash my mouth out with soap.
«OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things. »  Alan Kay's clarification on what he meant by the term "Object" in "Object-Oriented Programming."


modified 12-Dec-14 0:09am.

GeneralRe: Extension method for a list Pin
Agent__00711-Dec-14 16:31
professionalAgent__00711-Dec-14 16:31 

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.