Click here to Skip to main content
15,910,234 members
Home / Discussions / C#
   

C#

 
QuestionHow to convert Date of v.b to DateTime of c# Pin
Dj@y4-Aug-14 3:29
professionalDj@y4-Aug-14 3:29 
AnswerRe: How to convert Date of v.b to DateTime of c# Pin
OriginalGriff4-Aug-14 4:45
mveOriginalGriff4-Aug-14 4:45 
AnswerRe: How to convert Date of v.b to DateTime of c# Pin
jschell4-Aug-14 11:22
jschell4-Aug-14 11:22 
AnswerRe: How to convert Date of v.b to DateTime of c# Pin
V.5-Aug-14 0:05
professionalV.5-Aug-14 0:05 
QuestionDelete file which was in Picture Box before loading another Picture Pin
Alston Antony2-Aug-14 18:02
Alston Antony2-Aug-14 18:02 
AnswerRe: Delete file which was in Picture Box before loading another Picture Pin
Mycroft Holmes2-Aug-14 22:45
professionalMycroft Holmes2-Aug-14 22:45 
AnswerRe: Delete file which was in Picture Box before loading another Picture Pin
Ravi Bhavnani3-Aug-14 9:04
professionalRavi Bhavnani3-Aug-14 9:04 
Questionwant to add a text box on master page Pin
Atul 19892-Aug-14 2:19
Atul 19892-Aug-14 2:19 
SuggestionRe: want to add a text box on master page Pin
Richard MacCutchan2-Aug-14 2:53
mveRichard MacCutchan2-Aug-14 2:53 
SuggestionRe: want to add a text box on master page Pin
Richard Deeming4-Aug-14 2:19
mveRichard Deeming4-Aug-14 2:19 
AnswerRe: want to add a text box on master page Pin
Sibeesh KV29-Sep-14 19:50
professionalSibeesh KV29-Sep-14 19:50 
QuestionTreeview control with Newick format Pin
Abolfazl Ghavidel1-Aug-14 21:08
Abolfazl Ghavidel1-Aug-14 21:08 
AnswerRe: Treeview control with Newick format Pin
Eddy Vluggen3-Aug-14 1:54
professionalEddy Vluggen3-Aug-14 1:54 
QuestionHow can we create a photo gallery in C# Pin
Member 109104631-Aug-14 7:59
Member 109104631-Aug-14 7:59 
AnswerRe: How can we create a photo gallery in C# Pin
Richard Andrew x641-Aug-14 9:04
professionalRichard Andrew x641-Aug-14 9:04 
AnswerRe: How can we create a photo gallery in C# Pin
wisdom123-Aug-14 1:45
wisdom123-Aug-14 1:45 
AnswerRe: How can we create a photo gallery in C# Pin
Ravi Bhavnani3-Aug-14 9:06
professionalRavi Bhavnani3-Aug-14 9:06 
QuestionHow can i make a DVR Server ? i want to connect to more than one DVR from the Internet using ASP.NET Website. Pin
Aimanzaki1-Aug-14 5:36
Aimanzaki1-Aug-14 5:36 
AnswerRe: How can i make a DVR Server ? i want to connect to more than one DVR from the Internet using ASP.NET Website. Pin
Richard Andrew x641-Aug-14 6:25
professionalRichard Andrew x641-Aug-14 6:25 
QuestionGet smart card certificates on a Windows Mobile 6 application and Compact Framework Pin
Wakonda30-Jul-14 20:47
Wakonda30-Jul-14 20:47 
AnswerRe: Get smart card certificates on a Windows Mobile 6 application and Compact Framework Pin
Wakonda8-Sep-14 2:48
Wakonda8-Sep-14 2:48 
QuestionHow to compare the next/previous items in List in C# using linq Pin
Member 1098134230-Jul-14 6:02
Member 1098134230-Jul-14 6:02 
AnswerRe: How to compare the next/previous items in List in C# using linq Pin
Richard Deeming30-Jul-14 7:11
mveRichard Deeming30-Jul-14 7:11 
So you only want to combine two adjacent items, even if the third item starts at the same time as the second item ends?

Something like this should do the trick:
C#
public static IEnumerable<Appointment> CombineAdjacentAppointments(
    this IEnumerable<Appointment> appointments, 
    Func<Appointment, Appointment, Appointment> combineAppointments)
{
    Appointment previous = null;
    foreach (Appointment current in appointments)
    {
        if (previous == null)
        {
            previous = current;
        }
        else if (previous.EndDate != current.StartDate)
        {
            yield return previous;
            previous = current;
        }
        else
        {
            yield return combineAppointments(previous, current);
            previous = null;
        }
    }
    if (previous != null)
    {
        yield return previous;
    }
}
...
var combinedAppointments = ListAllAppointments().CombineAdjacentAppointments((first, second) => new Appointment 
{
    StartTime = first.StartTime, 
    EndTime = second.EndTime,
});




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


AnswerRe: How to compare the next/previous items in List in C# using linq Pin
Member 109862521-Aug-14 8:26
Member 109862521-Aug-14 8:26 
QuestionExtract text from PDF in C# using Mupdf library Pin
tmiklos6730-Jul-14 1:19
tmiklos6730-Jul-14 1:19 

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.