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

C#

 
GeneralRe: overlap Pin
Member 1038120911-Nov-13 8:38
Member 1038120911-Nov-13 8:38 
GeneralRe: overlap Pin
Richard MacCutchan11-Nov-13 22:28
mveRichard MacCutchan11-Nov-13 22:28 
QuestionradTreeListView - allow selection of items only at the same hierarchy Pin
devenv.exe5-Nov-13 19:57
professionaldevenv.exe5-Nov-13 19:57 
AnswerRe: radTreeListView - allow selection of items only at the same hierarchy Pin
Mycroft Holmes5-Nov-13 20:23
professionalMycroft Holmes5-Nov-13 20:23 
GeneralRe: radTreeListView - allow selection of items only at the same hierarchy Pin
BillWoodruff5-Nov-13 21:56
professionalBillWoodruff5-Nov-13 21:56 
GeneralRe: radTreeListView - allow selection of items only at the same hierarchy Pin
Mycroft Holmes5-Nov-13 23:11
professionalMycroft Holmes5-Nov-13 23:11 
AnswerRe: radTreeListView - allow selection of items only at the same hierarchy Pin
BillWoodruff5-Nov-13 20:51
professionalBillWoodruff5-Nov-13 20:51 
Questiondatetime overlap there result should be 2192 not 2923 Pin
Member 103812095-Nov-13 1:11
Member 103812095-Nov-13 1:11 
C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        DateTime[] start = new DateTime[] { new DateTime(2000, 1, 1), new DateTime(2004, 1, 1),  
                                         new DateTime(2004, 1, 1), new DateTime(2008, 1, 1) };
        DateTime[] end   = new DateTime[] { new DateTime(2002, 1, 1), new DateTime(2006, 1, 1),           
                                            new DateTime(2006, 1, 1), new DateTime(2010, 1, 1) };

        int timeDifference = 0;
        TimeSpan timespan;

     
        private void button1_Click(object sender, EventArgs e)
        {
            for (int i=0; i<end.Length-2; i++)
            {
    if (end[i] < end[i + 1] && start[i] <start[i +="" 1]="" &&="" start[i="" 1]<="end[i])
" {
="" timespan="(end[i]" -="" start[i])="" (end[i="" end[i]);
="" }

="" if="" (end[i]="">= end[i + 1] && start[i] <= start[i + 1])          
                {
                    timespan = (end[i] - start[i]);
                }
    if (end[i] > end[i + 1] && start[i] > start[i + 1] && start[i] <= end[i + 1])         
                {
                    timespan = (end[i] - start[i]) + (end[i + 1] - end[i]);
                }
           
    if (end[i] <= end[i + 1] && start[i] >= start[i + 1])
                {        timespan = (end[i + 1] - start[i + 1]);
                }

                timeDifference = timespan.Days + timeDifference;

            }
                MessageBox.Show(timeDifference.ToString());

            }

        }
    }

QuestionRe: datetime overlap there result should be 2192 not 2923 Pin
Richard MacCutchan5-Nov-13 1:19
mveRichard MacCutchan5-Nov-13 1:19 
AnswerRe: datetime overlap there result should be 2192 not 2923 Pin
Member 103812095-Nov-13 1:28
Member 103812095-Nov-13 1:28 
GeneralRe: datetime overlap there result should be 2192 not 2923 Pin
Member 103812095-Nov-13 1:30
Member 103812095-Nov-13 1:30 
GeneralRe: datetime overlap there result should be 2192 not 2923 Pin
Richard MacCutchan5-Nov-13 1:37
mveRichard MacCutchan5-Nov-13 1:37 
GeneralRe: datetime overlap there result should be 2192 not 2923 Pin
Member 103812095-Nov-13 1:45
Member 103812095-Nov-13 1:45 
GeneralRe: datetime overlap there result should be 2192 not 2923 Pin
Richard MacCutchan5-Nov-13 1:56
mveRichard MacCutchan5-Nov-13 1:56 
GeneralRe: datetime overlap there result should be 2192 not 2923 Pin
Member 103812095-Nov-13 2:43
Member 103812095-Nov-13 2:43 
GeneralRe: datetime overlap there result should be 2192 not 2923 Pin
GuyThiebaut5-Nov-13 4:27
professionalGuyThiebaut5-Nov-13 4:27 
QuestionPlz Help Me !! C sharp project With Linq Pin
Mehradjj4-Nov-13 21:02
Mehradjj4-Nov-13 21:02 
AnswerRe: Plz Help Me !! C sharp project With Linq Pin
Mycroft Holmes4-Nov-13 21:24
professionalMycroft Holmes4-Nov-13 21:24 
AnswerRe: Plz Help Me !! C sharp project With Linq Pin
Richard MacCutchan4-Nov-13 22:46
mveRichard MacCutchan4-Nov-13 22:46 
AnswerRe: Plz Help Me !! C sharp project With Linq Pin
V.5-Nov-13 3:18
professionalV.5-Nov-13 3:18 
Questionhow to run commands in command prompt in remote computer and save output in local file Pin
superselector4-Nov-13 18:01
superselector4-Nov-13 18:01 
AnswerRe: how to run commands in command prompt in remote computer and save output in local file Pin
Abhinav S4-Nov-13 18:10
Abhinav S4-Nov-13 18:10 
GeneralRe: how to run commands in command prompt in remote computer and save output in local file Pin
superselector4-Nov-13 19:46
superselector4-Nov-13 19:46 
AnswerRe: how to run commands in command prompt in remote computer and save output in local file Pin
Abhinav S4-Nov-13 20:11
Abhinav S4-Nov-13 20:11 
AnswerRe: how to run commands in command prompt in remote computer and save output in local file Pin
Pete O'Hanlon4-Nov-13 20:04
mvePete O'Hanlon4-Nov-13 20:04 

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.