Click here to Skip to main content
15,887,267 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Using Proxies with HttpWebRequests Pin
Eddy Vluggen8-Nov-15 4:06
professionalEddy Vluggen8-Nov-15 4:06 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 4:09
Member 113675538-Nov-15 4:09 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Eddy Vluggen8-Nov-15 4:22
professionalEddy Vluggen8-Nov-15 4:22 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 4:32
Member 113675538-Nov-15 4:32 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
Eddy Vluggen8-Nov-15 4:53
professionalEddy Vluggen8-Nov-15 4:53 
GeneralRe: C# Using Proxies with HttpWebRequests Pin
John Torjo8-Nov-15 19:09
professionalJohn Torjo8-Nov-15 19:09 
Questionprevent method execution on design time using attributes Pin
Gilbert Consellado7-Nov-15 15:59
professionalGilbert Consellado7-Nov-15 15:59 
AnswerRe: prevent method execution on design time using attributes Pin
George Jonsson7-Nov-15 18:00
professionalGeorge Jonsson7-Nov-15 18:00 
As far as I know there is no such attribute predefined. I could be wrong, though.

You could always design your own attribute, Writing Custom Attributes[^], but I don't really see the point in this case.
What you want is for Visual Studio to recognize your method as executable only at runtime, without any extra code necessary.
However, if you write your own attribute you also need to write the code to access it, Accessing Custom Atributes[^].

That would be a lot more work than doing it like this
C#
public void RunTimeOnlyMethod()
{
    if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)
        return;

    // The rest of the code
}

This way you move the logic into the method that knows if it should be executed or not, instead of having logic in the calling method.
AnswerRe: prevent method execution on design time using attributes Pin
Richard MacCutchan7-Nov-15 21:11
mveRichard MacCutchan7-Nov-15 21:11 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 1:33
professionalGilbert Consellado8-Nov-15 1:33 
AnswerRe: prevent method execution on design time using attributes Pin
OriginalGriff7-Nov-15 22:48
mveOriginalGriff7-Nov-15 22:48 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 1:35
professionalGilbert Consellado8-Nov-15 1:35 
GeneralRe: prevent method execution on design time using attributes Pin
OriginalGriff8-Nov-15 1:41
mveOriginalGriff8-Nov-15 1:41 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 3:31
professionalGilbert Consellado8-Nov-15 3:31 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 3:37
professionalGilbert Consellado8-Nov-15 3:37 
GeneralRe: prevent method execution on design time using attributes Pin
OriginalGriff8-Nov-15 4:03
mveOriginalGriff8-Nov-15 4:03 
GeneralRe: prevent method execution on design time using attributes Pin
Gilbert Consellado8-Nov-15 14:38
professionalGilbert Consellado8-Nov-15 14:38 
AnswerRe: prevent method execution on design time using attributes Pin
Nathan Minier9-Nov-15 3:18
professionalNathan Minier9-Nov-15 3:18 
Questiongdi+ shape is not a reference object in Arraylist? Pin
smallkubi7-Nov-15 5:47
smallkubi7-Nov-15 5:47 
AnswerRe: gdi+ shape is not a reference object in Arraylist? Pin
Richard MacCutchan7-Nov-15 6:14
mveRichard MacCutchan7-Nov-15 6:14 
GeneralRe: gdi+ shape is not a reference object in Arraylist? Pin
smallkubi7-Nov-15 14:01
smallkubi7-Nov-15 14:01 
GeneralRe: gdi+ shape is not a reference object in Arraylist? Pin
Richard MacCutchan7-Nov-15 21:07
mveRichard MacCutchan7-Nov-15 21:07 
AnswerRe: gdi+ shape is not a reference object in Arraylist? Pin
George Jonsson7-Nov-15 17:40
professionalGeorge Jonsson7-Nov-15 17:40 
GeneralRe: gdi+ shape is not a reference object in Arraylist? Pin
smallkubi7-Nov-15 22:06
smallkubi7-Nov-15 22:06 
GeneralRe: gdi+ shape is not a reference object in Arraylist? Pin
George Jonsson7-Nov-15 22:41
professionalGeorge Jonsson7-Nov-15 22:41 

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.