06 2013 档案

摘要:命名文件名和Class要一致(CamelCase)类公共和保护类型Property(CamelCase)类的公共和保护类型Fields(CamelCase)* 先采用.Net的命名方法,如果出现问题以后改成小写。Methord和Function(CamelCase)私有字段或者Property(_camelCase)parameter(camelCase)定义变量的位置最好在使用前,离得越近越好Type Var var x = 0; //x is an int var x = 0f; //x is a float var x = new Dictionary(); // x ... 阅读全文
posted @ 2013-06-27 16:36 若愚Shawn 阅读(416) 评论(0) 推荐(0)
摘要:特性(attribute)是被指定给某一声明的一则附加的声明性信息。 元数据,就是C#中封装的一些类,无法修改.类成员的特性被称为元数据中的注释. 1、什么是特性 1)属性与特性的区别属性(Property):属性是面向对象思想里所说的封装在类里面的数据字段,Get,Set方法。特性(Attribute):官方解释:特性是给指定的某一声明的一则附加 的声明性信息。 允许类似关键字的描述声明。它对程序中的元素进行标注,如类型、字段、方法、属性等。 从.net角度看,特性是一种 类,这些类继承于System.Attribute类,用于对类、属性、方法、事件等进行描述,主要用在反射中。但从面向... 阅读全文
posted @ 2013-06-26 10:14 若愚Shawn 阅读(2341) 评论(0) 推荐(0)
摘要:Windows Method 1: Using the Command Prompt1Click on theStartbutton.2Typecmdin the search bar, right above the Start button, and pressEnter. This will open the command prompt.If you're using Windows XP, clickRun, typecmd, and pressEnter.3At the command prompt, typeipconfig /alland pressEnter. Don 阅读全文
posted @ 2013-06-26 08:45 若愚Shawn 阅读(790) 评论(0) 推荐(0)
摘要://十进制转二进制 Console.WriteLine(Convert.ToString(69, 2)); //十进制转八进制 Console.WriteLine(Convert.ToString(69, 8)); //十进制转十六进制 Console.WriteLine(Convert.ToString(69, 16)); //二进制转十进制 Console.WriteLine(Convert.ToInt32(”100111101″, 2)); //八进制转十进制 Console.WriteLine(Convert.ToInt32(”76″, 8)); //十六进制转十进制 Console. 阅读全文
posted @ 2013-06-25 15:10 若愚Shawn 阅读(5808) 评论(0) 推荐(0)
摘要:封装field一般为private,定义的时候可以不赋值。不赋值的时候一般被构造函数初始化赋值,其值用来保存类实例的数据,可以被内部方法使用作为计算的数据来源。当需要继承类继承本类的时候,field要改为protected类型,这样继承类时子类可以对基类的field有完全访问权。property一般为public,是向外暴露的窗口,属性可以为其他外部类使用。方法可以是public的,用来向外暴露,外部可以直接调用。继承如果子类继承于父类,第一:子类拥有父类非private的属性和功能;第二:子类具有自己的属性和功能,即子类可以扩展父类没有的属性和功能;第三:子类还可以以自己的方式实现父类的功能 阅读全文
posted @ 2013-06-20 10:12 若愚Shawn 阅读(410) 评论(0) 推荐(0)
摘要:- System.IO.FileInfo- System.IO.DirectoryInfo MSDN- System.IO.Directory- System.IO.FileView Code using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.IO; namespace ConsoleApplication3 { class Program { stat... 阅读全文
posted @ 2013-06-16 11:14 若愚Shawn 阅读(398) 评论(0) 推荐(0)
摘要:Field initializers赋值可以直接给值,也可以是对象。建议不直接给filed initialzer赋值,当继承的时候会出现顺序的怪异问题:解决方法:在constructor里给filed赋值注意如果是继承类,自己ctor之前先要ctor基类。叫public Person()的时候会先跳到上面的基类public Base()先。using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleA 阅读全文
posted @ 2013-06-15 16:09 若愚Shawn 阅读(288) 评论(0) 推荐(0)
摘要:Nested typesClass和Structure里可以nest任意多的类型(包括class),但是Enum里不可以。class{ enum ParserState { }}Class Person{ Class Room{} enum GunType{}}View Code Access modifiersInternal:只包在本assemble(ClassLibrary编译后是dll,ConsoleApplication16编译后是exe文件,这是两个独立的Assembly)里使用。 其他Assembly不可见。上面ClassLibrary1是一个cla... 阅读全文
posted @ 2013-06-15 12:16 若愚Shawn 阅读(257) 评论(0) 推荐(0)
摘要:问题外层MainWindow.xaml里有一个Container(ContentPresenter),调用一个CreateJob 页面,里面是一行行的,最后一个是。因为会调用不同的子页面,这个Containner(ContentPresenter)需要写清TabNavigation的方式,这里是Local而里面这些Textblock设置了一定顺序的Index,最后一个是的index是最大的。但是这个datapicker是由一个DataTemplate组成的,其再内层是一个TextBlock和一个Button组成。问题是KeyboardTab不会走到内层的DataPicker的Button中。解 阅读全文
posted @ 2013-06-12 15:11 若愚Shawn 阅读(737) 评论(0) 推荐(0)
摘要:Binary File Operationhttp://blog.sina.com.cn/s/blog_6f7e825501015ogy.htmlhttp://www.mzwu.com/article.asp?id=2364http://blog.csdn.net/longge7685/article/details/4620893StreamWriter & StreamReader最简单的实例:using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.Te 阅读全文
posted @ 2013-06-03 16:17 若愚Shawn 阅读(576) 评论(0) 推荐(0)