/// This is fake class for quick copy paste. Usage:
/// type HowTo. - the intellisense will display the names you have figured out for each fake method
/// select the name from the list , click in it , right button , G , will get you there ,
/// copy paste the text , Alt + F, C to close and remember to delete the fake call.
///
public class HowTo
{
public static void SettersAndGetters ()
{
//how-to generate those in textpad F8
// how-to Generate member accessors , properties for C# asp.net with textpad
// how-to setters and getters
// find:^(.*)$
// replace:private string s\1 ; \n public string \1 { \n \t\t get { return s\1 ; } \n \t\t set { s\1 = value ; } \n } //comm -- eof \1 property \n\n
//find:^(.*) (.*)$
//private string s\1 ; \n public string \1 { \n \t\t get { return s\1 ; } \n \t\t set { s\1 = value ; } \n } //comm -- eof \1 property \n\n
//
//private \1 _\2 ; \npublic \1 \2 { \n \t\t get { return _\2 ; } \n \t\t set { _\2 = value ; } \n } //eof property \2 \n\n\n
//
////for the constructor
//_\2= this.\2 ;
//
////for the passing to the constuctor
//\1 _\2 ,
} //eof method SettersAndGetters
public static void shortcuts ()
{
string _shortcuts =
@"
//how-to shortcuts
//Ctrl + Shift + F -- recursive find
//Ctrl + H -- find and replace
//Ctrl + M + M -- collapse method
//Ctrl + B --- set a break point
//CTRL + “-” and CTRL + SHIFT + “-” -- web browser like backward and forward in code
//Ctrl + Tab --- shift tabs
//Shift + F5 --- stop debugging
//F5 -- start debugging"
; }
public static void redirectToCurrentUrl () {
string _redirectToCurrentUrl =
@"
Response.Redirect ( System.IO.Path.GetFileName ( System.Web.HttpContext.Current.Request.Url.AbsolutePath ) , false );
" ;
} //eof method
public static void formTypes ()
{
string _formTypes =
@"
//how-to forms 1 - Empty Search Form , 2 - Filled Form , 3 - Empty New form ( new Margin Data , new Project )
//how-to formTypes
//, 4 - filled search form from get by id procedure
// 5 - FilledSearchForm (coming from params)
";
} //eof formTypes
public static void GetTheFileNameWithoutTheExtension ()
{
string s =
@"how-to get the file name requested without the extension in asp.net";
/*debugStart Utils.Debugger.WriteIf ( "My page name without extension is " +
System.IO.Path.GetFileNameWithoutExtension (
System.Web.HttpContext.Current.Request.Url.AbsolutePath ) );
/*debugEnd*/
} //eof methoed
public static void GetThePhysicalRootPathNoExtension ()
{
//how-to get the physical root path on the file system of the application
//string rootPath = Server.MapPath("~"); Utils.Debugger.WriteIf ( "My rootPath is " + rootPath );
} //eof method
public static void AccessConfVariables ()
{
//how-to access conf variables BL.Conf.Instance.Vars [ "varName" ] would give you "theVarName ;
} //eof method
public static void GetRowColumnValue ()
{
//how-to get row column value
//(ds.Tables["TableName"].Rows[0]["ColumnName"] == DBNull.Value ) ? false : (bool)ds.Tables["TableName"].Rows[0]["ColumnName"] ;
} //eof method
public static void GenerateExtendedPropertiesForATable()
{
//table column
//find:^(.*) (.*)$
//Replace:
//EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'title="\2",visible="1",fs="Basic Details",readonly="1"' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'\1', @level2type=N'COLUMN',@level2name=N'\2'
} //eof method
public static void RedirectToTheCurrentURL()
{
//how-to redirect to current url = users.aspx or projects.aspx
//Response.Redirect( System.IO.Path.GetFileName ( System.Web.HttpContext.Current.Request.Url.AbsolutePath ) , false );
} //eof method
public static void THEORY ()
{
//EVENTS AND DELEGATES IN ASP.NET -- http://msdn.microsoft.com/en-us/library/17sde2xt.aspx
} //eof method
public static void CopyMeAsTemplateMethod ()
{ } //eof method
} //eof class HowTo