Browse by Tags

All Tags » Refactoring (RSS)

Question from Tapuz .Net forum: Refactoring code for code review

שאלה: יש לי מערך של קבציםומערך של אובייקטים המכיל ערך ישן וערך חדש. אני צריכה להחליף בכל הקבצים את הערך הישן לערך החדש. אני עשיתי את זה כך / אשמח לשמוע ביקורת לכאן ולכאן או אפשרות לשיפור הביצועים. מה דעתכם? האם יש דרך לשפר? public static void Main() { //רשימה של השמות הישנים והשמות החדשים על מנת להחליף את הטקסט List < manageFiles > mf = new List < manageFiles >(); mf.Add( new manageFiles ( "replace me" , "with me" )); //רשימת הקבצים החדשה List < string > filesUrl = new List <...

Question from .Net Tapuz forum: Refactoring Code-behind to Static Methods and Properties example

שאלה: יש לי את הקוד הבא ואני בטוח שיש דרך יותר טובה ונקייה לכתוב אותו, למישהו יש רעיונות? // טבלא ראשית Table MainTbl = new Table(); // הגדרות עבור טבלא MainTbl.CellPadding = 0; MainTbl.CellSpacing = 0; MainTbl.Width = Unit.Parse( "456" ) ; TableRow MainRow = new TableRow(); MainTbl.Rows.Add(MainRow); // טור קו שמאלי של טבלא ראשית TableCell MainLineLeftCell = new TableCell(); MainRow.Cells.Add(MainLineLeftCell); MainLineLeftCell.Width = Unit.Parse( "1px" ); MainLineLeftCell.Height = Unit.Parse( ...