Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
AnswerRe: ResxResourceWriter not available Pin
Dave Kreskowiak30-Nov-05 9:37
mveDave Kreskowiak30-Nov-05 9:37 
GeneralRe: ResxResourceWriter not available Pin
malharone30-Nov-05 10:00
malharone30-Nov-05 10:00 
GeneralRe: ResxResourceWriter not available Pin
Dave Kreskowiak30-Nov-05 10:42
mveDave Kreskowiak30-Nov-05 10:42 
GeneralRe: ResxResourceWriter not available Pin
malharone30-Nov-05 10:51
malharone30-Nov-05 10:51 
QuestionDesign question Pin
Stefan Troschuetz30-Nov-05 7:51
Stefan Troschuetz30-Nov-05 7:51 
AnswerRe: Design question Pin
ventomito30-Nov-05 9:07
ventomito30-Nov-05 9:07 
AnswerRe: Design question Pin
Stan Shannon30-Nov-05 9:32
Stan Shannon30-Nov-05 9:32 
GeneralRe: Design question Pin
Stefan Troschuetz30-Nov-05 23:39
Stefan Troschuetz30-Nov-05 23:39 
At first thanks for the answer.
The class I'm writing is part of a class library, so the variable may be exposed to the user via GUI but didn't necessarily have to. So I'm searching for a way, to let an user of the class check for validity of an assigned value no matter if it happens directly in code or via GUI. Currently I favor the following solution:
public double Alpha
{  
  set  
  {    
    if (value <= 0)
      throw new ArgumentOutOfRangeException("Assigned value has to be greater 0");

    this.alpha = value;
  }
}
public bool IsValidAlpha(double value)
{
    return value > 0;
}
}

//User of the class then can do
if (obj.IsValidAlpha(1.0))
  obj.Alpha = 1.0;
else
  ...








www.troschuetz.de

-- modified at 5:41 Thursday 1st December, 2005
AnswerRe: Design question Pin
WillemM30-Nov-05 21:56
WillemM30-Nov-05 21:56 
GeneralRe: Design question Pin
Stefan Troschuetz30-Nov-05 23:43
Stefan Troschuetz30-Nov-05 23:43 
GeneralRe: Design question Pin
Dan Neely1-Dec-05 3:23
Dan Neely1-Dec-05 3:23 
GeneralRe: Design question Pin
Stefan Troschuetz1-Dec-05 4:02
Stefan Troschuetz1-Dec-05 4:02 
QuestionCannot combine ref and params!!! What to do? Pin
smurfy3430-Nov-05 7:39
smurfy3430-Nov-05 7:39 
AnswerRe: Cannot combine ref and params!!! What to do? Pin
Judah Gabriel Himango30-Nov-05 11:17
sponsorJudah Gabriel Himango30-Nov-05 11:17 
QuestionReading specific bit values from a file. Pin
Jim Taylor30-Nov-05 7:26
Jim Taylor30-Nov-05 7:26 
AnswerRe: Reading specific bit values from a file. Pin
Christian Graus30-Nov-05 14:05
protectorChristian Graus30-Nov-05 14:05 
GeneralMany thanks, that works for me. Pin
Jim Taylor30-Nov-05 23:46
Jim Taylor30-Nov-05 23:46 
QuestionSetting the starting &quot;keyboard position&quot; in a listview Pin
Dan Neely30-Nov-05 7:00
Dan Neely30-Nov-05 7:00 
AnswerRe: Setting the starting &amp;quot;keyboard position&amp;quot; in a listview Pin
Dan Neely30-Nov-05 7:01
Dan Neely30-Nov-05 7:01 
QuestionSpeed up Switching TreeView View Type Pin
notacake30-Nov-05 6:24
notacake30-Nov-05 6:24 
AnswerRe: Speed up Switching TreeView View Type Pin
KaptinKrunch30-Nov-05 6:42
KaptinKrunch30-Nov-05 6:42 
GeneralRe: Speed up Switching TreeView View Type Pin
notacake30-Nov-05 6:59
notacake30-Nov-05 6:59 
AnswerRe: Speed up Switching TreeView View Type Pin
Joel Lucsy3-Dec-05 7:42
Joel Lucsy3-Dec-05 7:42 
QuestionTriangle change size? How to dash line? Pin
...---...30-Nov-05 5:07
...---...30-Nov-05 5:07 
AnswerRe: Triangle change size? How to dash line? Pin
freshonlineMax30-Nov-05 5:57
freshonlineMax30-Nov-05 5:57 

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.