Click here to Skip to main content
15,893,190 members
Home / Discussions / C#
   

C#

 
QuestionHow to make a setup of windows application Pin
Rameez Raja11-Feb-09 20:17
Rameez Raja11-Feb-09 20:17 
AnswerRe: How to make a setup of windows application Pin
Eddy Vluggen11-Feb-09 20:45
professionalEddy Vluggen11-Feb-09 20:45 
AnswerRe: How to make a setup of windows application Pin
Vimalsoft(Pty) Ltd11-Feb-09 22:38
professionalVimalsoft(Pty) Ltd11-Feb-09 22:38 
AnswerRe: How to make a setup of windows application Pin
erfi11-Feb-09 23:19
erfi11-Feb-09 23:19 
AnswerRe: How to make a setup of windows application Pin
DJ-Boris12-Feb-09 0:10
DJ-Boris12-Feb-09 0:10 
QuestionTreeView Pin
Udayaraju11-Feb-09 19:54
Udayaraju11-Feb-09 19:54 
AnswerRe: TreeView Pin
Udayaraju12-Feb-09 1:15
Udayaraju12-Feb-09 1:15 
AnswerRe: TreeView Pin
Jimmanuel12-Feb-09 3:07
Jimmanuel12-Feb-09 3:07 
Udayaraju wrote:
Is there any other way of implementing
like Switch or any other methods.


create functions to break the processing up into smaller routines. For example:

if (table != null)
{
    foreach (DataRow row in table.Rows)
    {
            MainNode = new TreeNode(row.ItemArray[0].ToString());
            MainNode.Name = row.ItemArray[0].ToString();
            ProcessRow(row, MainNode);
    }
}

private void ProcessRow (DataRow row, TreeNode MainNode)
{
   // ... 
}


and then try to break up the ProcessRow function into smaller ones. This should make it easier to see what's going on and possibly reduce some code duplication.

Visual Studio has built in refactoring tools to help with this kind of thing. Try highlighting all of the text inside of the foreach loop, goto the "Refactor" menu of the main VS toolbar and select "Extract Method" to have VS help break up your functions.



GeneralRe: TreeView Pin
Udayaraju15-Feb-09 4:53
Udayaraju15-Feb-09 4:53 
GeneralRe: TreeView Pin
Udayaraju15-Feb-09 5:09
Udayaraju15-Feb-09 5:09 
GeneralRe: TreeView Pin
Udayaraju15-Feb-09 5:20
Udayaraju15-Feb-09 5:20 
QuestionFile Processing Error Pin
MumbleB11-Feb-09 19:53
MumbleB11-Feb-09 19:53 
AnswerRe: File Processing Error Pin
ABitSmart11-Feb-09 21:04
ABitSmart11-Feb-09 21:04 
GeneralRe: File Processing Error Pin
MumbleB11-Feb-09 21:08
MumbleB11-Feb-09 21:08 
AnswerRe: File Processing Error Pin
Eddy Vluggen11-Feb-09 21:25
professionalEddy Vluggen11-Feb-09 21:25 
QuestionOn button click-context menu strip Pin
Udayaraju11-Feb-09 19:47
Udayaraju11-Feb-09 19:47 
AnswerRe: On button click-context menu strip Pin
ABitSmart11-Feb-09 20:08
ABitSmart11-Feb-09 20:08 
AnswerRe: On button click-context menu strip Pin
DaveyM6911-Feb-09 22:56
professionalDaveyM6911-Feb-09 22:56 
GeneralRe: On button click-context menu strip Pin
Udayaraju15-Feb-09 4:54
Udayaraju15-Feb-09 4:54 
GeneralRe: On button click-context menu strip Pin
DaveyM6915-Feb-09 6:33
professionalDaveyM6915-Feb-09 6:33 
Questionc# Pin
aratireddy11-Feb-09 17:14
aratireddy11-Feb-09 17:14 
AnswerRe: c# Pin
ABitSmart11-Feb-09 18:43
ABitSmart11-Feb-09 18:43 
QuestionHow to create and execute of a simple Function with input and output parameters in pl/sql using with c#.net Pin
AnilJayanti11-Feb-09 16:40
AnilJayanti11-Feb-09 16:40 
Questionleading numbers in a text string appearing at end of text in a Rich Text Box. Pin
Willbo_II11-Feb-09 15:15
Willbo_II11-Feb-09 15:15 
GeneralRe: leading numbers in a text string appearing at end of text in a Rich Text Box. Pin
Luc Pattyn11-Feb-09 16:02
sitebuilderLuc Pattyn11-Feb-09 16:02 

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.