Click here to Skip to main content
15,914,500 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Pointless .Net Feature of the Day Pin
Jalapeno Bob17-Jan-19 17:01
professionalJalapeno Bob17-Jan-19 17:01 
GeneralRe: Pointless .Net Feature of the Day Pin
GKP199216-Jan-19 1:09
professionalGKP199216-Jan-19 1:09 
GeneralRe: Pointless .Net Feature of the Day Pin
M!chael..Luna17-Jan-19 9:23
M!chael..Luna17-Jan-19 9:23 
GeneralRe: Pointless .Net Feature of the Day Pin
RugbyLeague16-Jan-19 1:10
RugbyLeague16-Jan-19 1:10 
GeneralRe: Pointless .Net Feature of the Day Pin
#realJSOP16-Jan-19 2:18
professional#realJSOP16-Jan-19 2:18 
GeneralRe: Pointless .Net Feature of the Day Pin
RugbyLeague16-Jan-19 3:23
RugbyLeague16-Jan-19 3:23 
GeneralRe: Pointless .Net Feature of the Day Pin
Slacker00716-Jan-19 6:00
professionalSlacker00716-Jan-19 6:00 
GeneralRe: Pointless .Net Feature of the Day PinPopular
Marc Clifton16-Jan-19 2:05
mvaMarc Clifton16-Jan-19 2:05 
The cool thing in the code below is that if you don't define LOGGING, not only does the partial method go away, but any calls to the method are also removed.

#define LOGGING

using System;

namespace PartialMethodTest
{
    partial class Foo
    {
        partial void Log(string msg);

        public void DoSomething()
        {
            Log("Fizbin");
        }
    }

#if LOGGING
    partial class Foo
    {
        partial void Log(string msg)
        {
            Console.WriteLine(msg);
        }
    }
#endif

    class Program
    {
        static void Main(string[] args)
        {
            new Foo().DoSomething();
        }
    }
}

Latest Article - A Concise Overview of Threads

Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny

Artificial intelligence is the only remedy for natural stupidity. - CDP1802

QuestionRe: Pointless .Net Feature of the Day Pin
CPallini16-Jan-19 2:26
mveCPallini16-Jan-19 2:26 
AnswerRe: Pointless .Net Feature of the Day Pin
den2k8816-Jan-19 2:43
professionalden2k8816-Jan-19 2:43 
GeneralRe: Pointless .Net Feature of the Day Pin
CPallini16-Jan-19 2:50
mveCPallini16-Jan-19 2:50 
GeneralRe: Pointless .Net Feature of the Day Pin
den2k8816-Jan-19 3:53
professionalden2k8816-Jan-19 3:53 
GeneralRe: Pointless .Net Feature of the Day Pin
CPallini16-Jan-19 4:32
mveCPallini16-Jan-19 4:32 
AnswerRe: Pointless .Net Feature of the Day Pin
Mladen Janković16-Jan-19 5:10
Mladen Janković16-Jan-19 5:10 
GeneralRe: Pointless .Net Feature of the Day Pin
CPallini16-Jan-19 7:03
mveCPallini16-Jan-19 7:03 
AnswerRe: Pointless .Net Feature of the Day Pin
Marc Clifton16-Jan-19 8:36
mvaMarc Clifton16-Jan-19 8:36 
GeneralRe: Pointless .Net Feature of the Day Pin
CPallini16-Jan-19 10:02
mveCPallini16-Jan-19 10:02 
GeneralRe: Pointless .Net Feature of the Day Pin
Kornfeld Eliyahu Peter16-Jan-19 3:02
professionalKornfeld Eliyahu Peter16-Jan-19 3:02 
GeneralRe: Pointless .Net Feature of the Day Pin
CPallini16-Jan-19 3:34
mveCPallini16-Jan-19 3:34 
GeneralRe: Pointless .Net Feature of the Day Pin
OriginalGriff16-Jan-19 3:41
mveOriginalGriff16-Jan-19 3:41 
GeneralRe: Pointless .Net Feature of the Day Pin
#realJSOP16-Jan-19 6:09
professional#realJSOP16-Jan-19 6:09 
GeneralRe: Pointless .Net Feature of the Day Pin
Rick York16-Jan-19 8:35
mveRick York16-Jan-19 8:35 
GeneralRe: Pointless .Net Feature of the Day Pin
Richard Deeming16-Jan-19 8:22
mveRichard Deeming16-Jan-19 8:22 
GeneralRe: Pointless .Net Feature of the Day Pin
Marc Clifton16-Jan-19 13:24
mvaMarc Clifton16-Jan-19 13:24 
GeneralRe: Pointless .Net Feature of the Day Pin
agolddog17-Jan-19 10:14
agolddog17-Jan-19 10:14 

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.