zoukankan      html  css  js  c++  java
  • DNN中的一个property 荣

    在DotNetNuke.UI.Utilities.ClientAPI中有这样一个Property:
    Private Shared ReadOnly Property ClientVariableControl(ByVal objPage As Page) As HtmlInputHidden
       Get
        Dim ctlVar As HtmlInputHidden = CType(DotNetNuke.UI.Utilities.Globals.FindControlRecursive(objPage, "__dnnVariable"), HtmlInputHidden)
        If ctlVar Is Nothing Then
         Dim ctlParent As Control       'error prone...  should put placeholder in page
         ctlParent = objPage.Controls(0)

         ctlVar = New HtmlInputHidden
         ctlVar.ID = "__dnnVariable"
         ctlParent.Controls.Add(ctlVar)
        End If
        Return ctlVar
       End Get
      End Property

    它是个只读Property,而且还提供了一个参数。这我就有点不明白了。
    这样的property和普通的方法有什么不同,为什么要写成property。那C#中对property来理解,好像还无法把这段代码转换成C#property,因为有参数。

  • 相关阅读:
    vue基础知识
    git的创建使用
    使用express搭建服务器框架
    日常训练
    今日收获
    今日收获
    今日收获
    今日收获
    今日收获
    今日收获
  • 原文地址:https://www.cnblogs.com/admin11/p/217370.html
Copyright © 2011-2022 走看看