`
lizheng30781546
  • 浏览: 4015 次
文章分类
社区版块
存档分类
最新评论

我来读代码之三(d-podium)

 
阅读更多

1:泛型

 System.Collections.Generic

http://msdn.microsoft.com/zh-cn/library/system.collections.generic(VS.80).aspx

GenericList<T> {         Node     {                 Node(T t)         {             next = ;             data = t;         }         Node next;         Node Next         {             { next; }             { next = value; }         }                         T data;                 T Data          {             { data; }             { data = value; }         }     }     Node head;             GenericList()     {         head = ;     }         AddHead(T t)     {         Node n = Node(t);         n.Next = head;         head = n;     }     IEnumerator<T> GetEnumerator()     {         Node current = head;         (current != )         {             yield current.Data;             current = current.Next;         }     } } ——————————————————————

TestGenericList {     Main()     {                 GenericList<> list = GenericList<>();         ( x = 0; x < 10; x++)         {             list.AddHead(x);         }         ( i list)         {             System.Console.Write(i + );         }         System.Console.WriteLine();     } }

 

 

 

 

 

2:?与??

变量定义中含有一个问号,意思是这个数据类型是NullAble类型的。 变量定义中含有两个问号,意思是取所赋值??左边的,如果左边为null,取所赋值??右边的。

cred.adaptorName = WebConfigurationManager.AppSettings["LDAPAdaptor"] ?? "Domestic";

3:public ItemMapping(Control target, String boundproperty, String targetproperty)             : this(target, boundproperty, targetproperty, null, null)这里的:表示继承,只能用于构造函数。         {         }

        public ItemMapping(Control target, String boundproperty):this(target, boundproperty,null,null,null)         {这里的:表示继承,只能用于构造函数。         }         public ItemMapping(Control target, String boundproperty, String targetproperty, String format, ICustomFormatter formatter)         {             if (target == null) throw new ArgumentNullException("target");             if (boundproperty == null) throw new ArgumentNullException("boundproperty");

            this.mTarget = target;             this.mBound = boundproperty;             this.mTgtProp = targetproperty;             this.mFormat = format;             this.mFormatter = formatter;         }

4:string.Format("Service Url:{0}", “aaabbbccc”)

....................................................................

5:

<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">             <triggers>                 <asp:AsyncPostBackTrigger ControlID="RadioButtonList1" EventName="SelectedIndexChanged"></asp:AsyncPostBackTrigger>                 <asp:AsyncPostBackTrigger ControlID="Search1" EventName="Click"></asp:AsyncPostBackTrigger>                 <asp:AsyncPostBackTrigger ControlID="Search" EventName="Click"></asp:AsyncPostBackTrigger>             </triggers>         </asp:UpdatePanel>

微软自带的ajax控件:Ajax Extensions。把你所需要异步update的区域用updatepanel包起来,然后设置哪些trigger可以影响这个panel。另外还需要ScriptManager这个控件。

注意;先创建一个Ajax Website(装AJAX时会装上ScriptManager的)

6:if (lst == null) throw new ArgumentNullException("lst"); throw,哈哈!

原作者:http://www.verydemo.com/demo_c107_i7771.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics