Click here to Skip to main content
15,905,325 members
Home / Discussions / C#
   

C#

 
QuestionHow to get data(json) to listview by MVVM? Pin
Lê Thiên Hoàng8-Nov-15 14:08
Lê Thiên Hoàng8-Nov-15 14:08 
AnswerRe: How to get data(json) to listview by MVVM? Pin
Nathan Minier9-Nov-15 3:15
professionalNathan Minier9-Nov-15 3:15 
GeneralRe: How to get data(json) to listview by MVVM? Pin
Lê Thiên Hoàng9-Nov-15 5:04
Lê Thiên Hoàng9-Nov-15 5:04 
GeneralRe: How to get data(json) to listview by MVVM? Pin
Lê Thiên Hoàng9-Nov-15 5:08
Lê Thiên Hoàng9-Nov-15 5:08 
QuestionHow to make a GUI in cosmos Pin
Member 121050098-Nov-15 9:29
Member 121050098-Nov-15 9:29 
AnswerRe: How to make a GUI in cosmos Pin
Richard Andrew x648-Nov-15 9:45
professionalRichard Andrew x648-Nov-15 9:45 
GeneralRe: How to make a GUI in cosmos Pin
BillWoodruff8-Nov-15 9:53
professionalBillWoodruff8-Nov-15 9:53 
GeneralRe: How to make a GUI in cosmos Pin
Richard Andrew x648-Nov-15 10:08
professionalRichard Andrew x648-Nov-15 10:08 
AnswerRe: How to make a GUI in cosmos Pin
Eddy Vluggen8-Nov-15 9:50
professionalEddy Vluggen8-Nov-15 9:50 
GeneralRe: How to make a GUI in cosmos Pin
BillWoodruff8-Nov-15 10:19
professionalBillWoodruff8-Nov-15 10:19 
GeneralRe: How to make a GUI in cosmos Pin
Eddy Vluggen9-Nov-15 1:14
professionalEddy Vluggen9-Nov-15 1:14 
QuestionC# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 3:36
Member 113675538-Nov-15 3:36 
QuestionRe: C# Using Proxies with HttpWebRequests Pin
Richard MacCutchan8-Nov-15 3:43
mveRichard MacCutchan8-Nov-15 3:43 
AnswerRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 3:45
Member 113675538-Nov-15 3:45 
QuestionRe: C# Using Proxies with HttpWebRequests Pin
Richard MacCutchan8-Nov-15 4:00
mveRichard MacCutchan8-Nov-15 4:00 
AnswerRe: C# Using Proxies with HttpWebRequests Pin
Member 113675538-Nov-15 4:01
Member 113675538-Nov-15 4:01 
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 
Is there a way to prevent a method from execution if it is in design time or the method can only be executed at runtime.

I got this problem while creating a custom control because there is a method call in the constructor that will only work at runtime.

now at design time while designing the form and use that control, then the form will generate the error. now i tried this at the constructor of the user control

C#
public ctrl_information()
    {
        InitializeComponent();
        if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)) return;
        SomeMethod();
        //Other code
    }

what i want to achieve is something like this
C#
[ExecuteOnlyAtRuntime]
public void SomeMethod()
{
     //Code here
}

then call it like this
C#
public ctrl_information()
    {
        InitializeComponent();
        //if (LicenseManager.UsageMode == LicenseUsageMode.Designtime)) return; -- removing this line
        //now the SomeMethod() will only be executed at runtime  not in design time
        SomeMethod();
    }

Is it possible?

Please shed some light on this.

Thank you
AnswerRe: prevent method execution on design time using attributes Pin
George Jonsson7-Nov-15 18:00
professionalGeorge Jonsson7-Nov-15 18:00 
AnswerRe: prevent method execution on design time using attributes Pin
Richard MacCutchan7-Nov-15 21:11
mveRichard MacCutchan7-Nov-15 21:11 

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.