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

C#

 
GeneralRe: How to get contents of cache memory in c#? Pin
Swapnil 200925-Oct-09 23:42
Swapnil 200925-Oct-09 23:42 
AnswerRe: How to get contents of cache memory in c#? Pin
Jaiprakash M Bankolli25-Oct-09 23:43
Jaiprakash M Bankolli25-Oct-09 23:43 
GeneralRe: How to get contents of cache memory in c#? Pin
Swapnil 200926-Oct-09 0:04
Swapnil 200926-Oct-09 0:04 
Questionproblem with custom control properties value Pin
Lyon Sun25-Oct-09 23:18
Lyon Sun25-Oct-09 23:18 
AnswerMessage Closed Pin
25-Oct-09 23:35
stancrm25-Oct-09 23:35 
GeneralRe: problem with custom control properties value Pin
Lyon Sun25-Oct-09 23:45
Lyon Sun25-Oct-09 23:45 
GeneralRe: problem with custom control properties value Pin
Lyon Sun26-Oct-09 0:01
Lyon Sun26-Oct-09 0:01 
AnswerRe: problem with custom control properties value Pin
Abhishek Sur25-Oct-09 23:42
professionalAbhishek Sur25-Oct-09 23:42 
Leapsword Sun wrote:
public int CurrentLine
{
get { return currentLine; }
set { currentLine = value; }
}


change this to

public int CurrentLine
{
     get { return currentLine; }
     set { 
           if(value < 1 || value > 100) throw new ApplicationException("Invalid Input");
            currentLine = value; 
         }
}


This will throw an exception for invalid values. You can modify this according to your need. Just modify the set portion of CurrentLine

Abhishek Sur
Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->

Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords
/xml>

GeneralRe: problem with custom control properties value Pin
Lyon Sun25-Oct-09 23:59
Lyon Sun25-Oct-09 23:59 
QuestionHow to get contents of cache memory in c#? Pin
snakeway42025-Oct-09 23:17
snakeway42025-Oct-09 23:17 
AnswerRe: How to get contents of cache memory in c#? Pin
Abhishek Sur25-Oct-09 23:34
professionalAbhishek Sur25-Oct-09 23:34 
QuestionOpening one file by two processes at same time in C# Pin
MikeSharp25-Oct-09 23:05
MikeSharp25-Oct-09 23:05 
AnswerRe: Opening one file by two processes at same time in C# Pin
Not Active25-Oct-09 23:16
mentorNot Active25-Oct-09 23:16 
AnswerRe: Opening one file by two processes at same time in C# Pin
Abhishek Sur25-Oct-09 23:29
professionalAbhishek Sur25-Oct-09 23:29 
QuestionHow to reference a DLL from a custom folder Pin
hirajhil25-Oct-09 22:22
hirajhil25-Oct-09 22:22 
AnswerRe: How to reference a DLL from a custom folder Pin
Christian Graus25-Oct-09 22:33
protectorChristian Graus25-Oct-09 22:33 
GeneralRe: How to reference a DLL from a custom folder Pin
hirajhil25-Oct-09 22:36
hirajhil25-Oct-09 22:36 
GeneralRe: How to reference a DLL from a custom folder Pin
Abhishek Sur25-Oct-09 22:52
professionalAbhishek Sur25-Oct-09 22:52 
GeneralRe: How to reference a DLL from a custom folder Pin
Giorgi Dalakishvili25-Oct-09 22:55
mentorGiorgi Dalakishvili25-Oct-09 22:55 
QuestionPowerShell Cmdlets Pin
satsumatable25-Oct-09 21:02
satsumatable25-Oct-09 21:02 
QuestionThanks for all Pin
Abdaqader25-Oct-09 20:37
Abdaqader25-Oct-09 20:37 
AnswerRe: Thanks for all Pin
Christian Graus25-Oct-09 21:17
protectorChristian Graus25-Oct-09 21:17 
AnswerRe: Thanks for all Pin
Pete O'Hanlon25-Oct-09 22:04
mvePete O'Hanlon25-Oct-09 22:04 
JokeRe: Thanks for all Pin
musefan25-Oct-09 23:00
musefan25-Oct-09 23:00 
AnswerRe: Thanks for all Pin
Nagy Vilmos25-Oct-09 23:04
professionalNagy Vilmos25-Oct-09 23:04 

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.