Click here to Skip to main content
15,917,702 members
Home / Discussions / C#
   

C#

 
AnswerRe: c sharp - Confusing string manipulation Pin
Matt T Heffron30-Apr-15 8:17
professionalMatt T Heffron30-Apr-15 8:17 
GeneralRe: c sharp - Confusing string manipulation Pin
David A. Gray1-May-15 11:13
David A. Gray1-May-15 11:13 
GeneralRe: c sharp - Confusing string manipulation Pin
Matt T Heffron1-May-15 11:31
professionalMatt T Heffron1-May-15 11:31 
GeneralRe: c sharp - Confusing string manipulation Pin
David A. Gray1-May-15 19:08
David A. Gray1-May-15 19:08 
QuestionCan any one help me to convert amatlab code to c# ,please? Pin
Member 1147426930-Apr-15 5:41
Member 1147426930-Apr-15 5:41 
AnswerRe: Can any one help me to convert amatlab code to c# ,please? Pin
OriginalGriff30-Apr-15 5:58
mveOriginalGriff30-Apr-15 5:58 
AnswerRe: Can any one help me to convert amatlab code to c# ,please? Pin
Eddy Vluggen30-Apr-15 5:58
professionalEddy Vluggen30-Apr-15 5:58 
GeneralRe: Can any one help me to convert amatlab code to c# ,please? Pin
Kenneth Haugland30-Apr-15 6:06
mvaKenneth Haugland30-Apr-15 6:06 
GeneralRe: Can any one help me to convert amatlab code to c# ,please? Pin
Eddy Vluggen30-Apr-15 8:51
professionalEddy Vluggen30-Apr-15 8:51 
GeneralRe: Can any one help me to convert amatlab code to c# ,please? Pin
Member 1147426930-Apr-15 11:01
Member 1147426930-Apr-15 11:01 
GeneralRe: Can any one help me to convert amatlab code to c# ,please? Pin
Eddy Vluggen30-Apr-15 11:22
professionalEddy Vluggen30-Apr-15 11:22 
GeneralRe: Can any one help me to convert amatlab code to c# ,please? Pin
Member 1147426930-Apr-15 11:37
Member 1147426930-Apr-15 11:37 
GeneralRe: Can any one help me to convert amatlab code to c# ,please? Pin
Eddy Vluggen30-Apr-15 21:39
professionalEddy Vluggen30-Apr-15 21:39 
AnswerRe: Can any one help me to convert amatlab code to c# ,please? Pin
Kenneth Haugland30-Apr-15 6:03
mvaKenneth Haugland30-Apr-15 6:03 
Questionproblem in code Port.ReadTo Pin
hasan hadi30-Apr-15 4:46
hasan hadi30-Apr-15 4:46 
Questionlocomp instrumentation Pin
hasan hadi30-Apr-15 4:11
hasan hadi30-Apr-15 4:11 
AnswerRe: locomp instrumentation Pin
Eddy Vluggen30-Apr-15 4:17
professionalEddy Vluggen30-Apr-15 4:17 
AnswerRe: locomp instrumentation Pin
OriginalGriff30-Apr-15 4:21
mveOriginalGriff30-Apr-15 4:21 
GeneralRe: locomp instrumentation Pin
hasan hadi30-Apr-15 5:41
hasan hadi30-Apr-15 5:41 
GeneralRe: locomp instrumentation Pin
OriginalGriff30-Apr-15 5:57
mveOriginalGriff30-Apr-15 5:57 
AnswerRe: locomp instrumentation Pin
Pete O'Hanlon30-Apr-15 5:22
mvePete O'Hanlon30-Apr-15 5:22 
GeneralRe: locomp instrumentation Pin
hasan hadi30-Apr-15 5:38
hasan hadi30-Apr-15 5:38 
Questionadd seven segment to visual studio 2012 Pin
hasan hadi30-Apr-15 3:43
hasan hadi30-Apr-15 3:43 
AnswerRe: add seven segment to visual studio 2012 Pin
Dave Kreskowiak30-Apr-15 3:46
mveDave Kreskowiak30-Apr-15 3:46 
AnswerRe: add seven segment to visual studio 2012 Pin
Sascha Lefèvre30-Apr-15 4:05
professionalSascha Lefèvre30-Apr-15 4:05 
I took your requirements as described (I even filled in some missing bits) and coded this for you:
C#
public class SevenSegment
{
    private bool[] Segments;

    public SevenSegment()
        : this(new bool[7])
    { }

    public SevenSegment(bool[] segments)
    {
        if (segments == null)
            throw new ArgumentNullException("segments");

        if (segments.Length != 7)
            throw new ArgumentException("segments");

        Segments = segments;
    }

    public bool this[int i]
    {
        get { return Segments[i];  }
        set { Segments[i] = value; }
    }
}

If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

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.