Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: how can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
Not Active28-Jun-11 15:45
mentorNot Active28-Jun-11 15:45 
AnswerRe: how can I retrieve values ​​from a textBox in another screen after the user set / send it Pin
BobJanova28-Jun-11 22:33
BobJanova28-Jun-11 22:33 
QuestionProblem with reteriving xml data from sql data base. Pin
prasadbuddhika28-Jun-11 0:23
prasadbuddhika28-Jun-11 0:23 
AnswerRe: Problem with reteriving xml data from sql data base. Pin
abhinish28-Jun-11 0:35
abhinish28-Jun-11 0:35 
QuestionProblem with Process.HasExited Pin
Nigel Mackay27-Jun-11 23:52
Nigel Mackay27-Jun-11 23:52 
AnswerRe: Problem with Process.HasExited PinPopular
BobJanova27-Jun-11 23:55
BobJanova27-Jun-11 23:55 
GeneralRe: Problem with Process.HasExited Pin
Nigel Mackay28-Jun-11 0:08
Nigel Mackay28-Jun-11 0:08 
QuestionCode style [modified] Pin
Lutosław27-Jun-11 23:43
Lutosław27-Jun-11 23:43 
What is better in terms of good coding practices:

protected virtual void RenderFilledHead(DrawingContext drawingContext)
{
    double y = NoteVerticalPosition;
    double yRadius = HeadYRadius * 1.1;
    double xRadius = HeadXRadius * 1.2;
    drawingContext.DrawEllipse(Brushes.Black, NoteHeadPen, new Point(xRadius / 2 + XOffset + 4.5, y), xRadius - 1, yRadius);
}
protected virtual void RenderEmptyHead(DrawingContext drawingContext)
{
    double y = NoteVerticalPosition;
    double yRadius = HeadYRadius * 1;
    double xRadius = HeadXRadius * 1;
    drawingContext.DrawEllipse(Brushes.Transparent, NoteBeamPen, new Point(xRadius / 2 + XOffset + 4.5, y), xRadius - 1, yRadius);
}

XOR
protected virtual void RenderHead(DrawingContext drawingContext, NoteHeadTypes type)
{
    double y = NoteVerticalPosition;
    double xRadius=0, yRadius=0;
    switch (type)
    {
        case NoteHeadTypes.Filled:
            yRadius = HeadYRadius * 1.1;
            xRadius = HeadXRadius * 1.2;
            drawingContext.DrawEllipse(Brushes.Black, NoteHeadPen, new Point(xRadius / 2 + XOffset + 4.5, y), xRadius - 1, yRadius)
            break;
        case NoteHeadTypes.Empty:
            yRadius = HeadYRadius;
            xRadius = HeadXRadius;
            drawingContext.DrawEllipse(Brushes.Transparent, NoteBeamPen, new Point(xRadius / 2 + XOffset + 4.5, y), xRadius - 1, yRadius);
        default:
            break;
    }
}


NOTE 1: there won't be any more HeadTypes probably.
NODE 2: No, it is not about empty or filled human heads, it's about musical notation Wink | ;)
Greetings - Jacek
EDIT: added "*1" to emphasize that it is a factor as good as '1.2'

AnswerRe: Code style Pin
V.27-Jun-11 23:50
professionalV.27-Jun-11 23:50 
AnswerRe: Code style [modified] Pin
Pete O'Hanlon28-Jun-11 0:00
mvePete O'Hanlon28-Jun-11 0:00 
GeneralRe: Code style Pin
BobJanova28-Jun-11 0:06
BobJanova28-Jun-11 0:06 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 0:30
mvePete O'Hanlon28-Jun-11 0:30 
GeneralRe: Code style Pin
Lutosław28-Jun-11 0:54
Lutosław28-Jun-11 0:54 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 1:07
mvePete O'Hanlon28-Jun-11 1:07 
GeneralRe: Code style Pin
Lutosław28-Jun-11 1:17
Lutosław28-Jun-11 1:17 
GeneralRe: Code style Pin
BobJanova28-Jun-11 2:41
BobJanova28-Jun-11 2:41 
AnswerRe: Code style Pin
BobJanova28-Jun-11 0:05
BobJanova28-Jun-11 0:05 
GeneralRe: Code style Pin
Lutosław28-Jun-11 1:03
Lutosław28-Jun-11 1:03 
AnswerRe: Code style PinPopular
Keith Barrow28-Jun-11 0:23
professionalKeith Barrow28-Jun-11 0:23 
GeneralRe: Code style Pin
Pete O'Hanlon28-Jun-11 0:34
mvePete O'Hanlon28-Jun-11 0:34 
GeneralRe: Code style Pin
Lutosław28-Jun-11 0:45
Lutosław28-Jun-11 0:45 
GeneralRe: Code style Pin
Keith Barrow28-Jun-11 1:22
professionalKeith Barrow28-Jun-11 1:22 
GeneralRe: Code style Pin
Lutosław28-Jun-11 1:50
Lutosław28-Jun-11 1:50 
GeneralRe: Code style Pin
Keith Barrow28-Jun-11 1:57
professionalKeith Barrow28-Jun-11 1:57 
GeneralRe: Code style Pin
BobJanova28-Jun-11 3:45
BobJanova28-Jun-11 3:45 

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.