Click here to Skip to main content
15,908,172 members
Home / Discussions / C#
   

C#

 
GeneralRe: Predicates and foreach Problem Pin
Jammer8-Jun-08 1:32
Jammer8-Jun-08 1:32 
GeneralRe: Predicates and foreach Problem [modified] Pin
Jammer8-Jun-08 2:31
Jammer8-Jun-08 2:31 
I have it working more reliably now that I've split the method like this:

private static void FilterDirectoryList()
{
    Table<DirectoryBlockingList> _directoryFilterList = _context.GetTable<DirectoryBlockingList>();
    foreach (DirectoryBlockingList _blockdir in _directoryFilterList)
    {
        _filterString = _blockdir.DirectoryName;
        RemoveRecords();
    }
}


private static void RemoveRecords()
{
    Debug.WriteLine(_filterString);
    _directoryList.RemoveAll(new Predicate<string>(delegate(string s)
    {
        //Debug.WriteLine(s + " " + s.Length.ToString());
        return string.Compare(s, 0, _filterString, 0, _filterString.Length) == 0;
    }));
}


However, I have now found out that my foreach loop using the linq Table<> hangs on the last item and never completes ... could this be related to the fact that it is a static class??

EDIT: Its all fine ... I've been caught out by the immediate window. When running the application in debug mode all worked as expected.

Jammer

Going where everyone here has gone before! Smile | :)
My Blog

modified on Sunday, June 8, 2008 8:39 AM

GeneralRe: Predicates and foreach Problem Pin
leppie8-Jun-08 2:48
leppie8-Jun-08 2:48 
QuestionApplications on Servers Pin
jonhbt7-Jun-08 22:50
jonhbt7-Jun-08 22:50 
AnswerRe: Applications on Servers Pin
Gareth H7-Jun-08 23:45
Gareth H7-Jun-08 23:45 
QuestionRe: Applications on Servers Pin
jonhbt7-Jun-08 23:59
jonhbt7-Jun-08 23:59 
AnswerRe: Applications on Servers Pin
Zoltan Balazs8-Jun-08 0:27
Zoltan Balazs8-Jun-08 0:27 
QuestionWhen do we have to use delegate in C#? Pin
Mohammad Dayyan7-Jun-08 22:46
Mohammad Dayyan7-Jun-08 22:46 
AnswerRe: When do we have to use delegate in C#? Pin
MarkB7777-Jun-08 23:44
MarkB7777-Jun-08 23:44 
GeneralRe: When do we have to use delegate in C#? Pin
Mohammad Dayyan8-Jun-08 0:52
Mohammad Dayyan8-Jun-08 0:52 
AnswerRe: When do we have to use delegate in C#? Pin
Zoltan Balazs8-Jun-08 0:31
Zoltan Balazs8-Jun-08 0:31 
GeneralRe: When do we have to use delegate in C#? Pin
Abdul Gafoor8-Jun-08 21:06
Abdul Gafoor8-Jun-08 21:06 
GeneralRe: When do we have to use delegate in C#? Pin
RobScripta8-Jun-08 21:24
professionalRobScripta8-Jun-08 21:24 
GeneralRe: When do we have to use delegate in C#? Pin
Abdul Gafoor8-Jun-08 23:12
Abdul Gafoor8-Jun-08 23:12 
Questiondeploying Release folder Pin
ASysSolvers7-Jun-08 22:06
ASysSolvers7-Jun-08 22:06 
AnswerRe: deploying Release folder Pin
Zoltan Balazs8-Jun-08 0:32
Zoltan Balazs8-Jun-08 0:32 
GeneralRe: deploying Release folder Pin
ASysSolvers8-Jun-08 0:38
ASysSolvers8-Jun-08 0:38 
GeneralRe: deploying Release folder Pin
Zoltan Balazs8-Jun-08 0:42
Zoltan Balazs8-Jun-08 0:42 
QuestionGet path to location user started setup.exe from [modified] Pin
Dave Buhl7-Jun-08 21:08
Dave Buhl7-Jun-08 21:08 
AnswerRe: Get path to location user started setup.exe from Pin
mav.northwind7-Jun-08 23:30
mav.northwind7-Jun-08 23:30 
GeneralRe: Get path to location user started setup.exe from Pin
Dave Buhl8-Jun-08 8:09
Dave Buhl8-Jun-08 8:09 
GeneralRe: Get path to location user started setup.exe from Pin
mav.northwind8-Jun-08 19:01
mav.northwind8-Jun-08 19:01 
QuestionImmediate Help Pin
Saiyed Alam7-Jun-08 19:49
Saiyed Alam7-Jun-08 19:49 
AnswerRe: Immediate Help Pin
DaveyM697-Jun-08 20:41
professionalDaveyM697-Jun-08 20:41 
GeneralRe: Immediate Help Pin
Saiyed Alam7-Jun-08 21:13
Saiyed Alam7-Jun-08 21:13 

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.