Click here to Skip to main content
15,885,767 members
Home / Discussions / C#
   

C#

 
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 
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 
What about the following:
C#
protected virtual void RenderHead(DrawingContext drawingContext, NoteHeadTypes type)
{
    double y = NoteVerticalPosition;
    double xRadius=HeadXRadius;
    double yRadius=HeadYRadius;
    Pen myPen = NoteBeamPen;
    Brush myBrush = Brushes.Transparent;
    switch (type)
    {
        case NoteHeadTypes.Filled:
            yRadius *= 1.1;
            xRadius *= 1.2;
            myPen = NoteHeadPen;
            myBrush = Brushes.Black;
            break;
        default:
            break;
    }
    drawingContext.DrawEllipse(myBrush, myPen, new Point(xRadius / 2 + XOffset + 4.5, y), xRadius - 1, yRadius);
}
[Edited]myPen wasn't allocated via a constructor, so it shouldn't be disposed, and I'd missed the alternate brush.

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility


modified on Tuesday, June 28, 2011 6:30 AM

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 
GeneralRe: Code style Pin
Keith Barrow28-Jun-11 7:32
professionalKeith Barrow28-Jun-11 7:32 
GeneralRe: Code style Pin
BobJanova28-Jun-11 7:42
BobJanova28-Jun-11 7:42 

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.