當前位置: 首頁>>代碼示例>>C#>>正文


C# UI.Control類代碼示例

本文整理匯總了C#中System.Web.UI.Control的典型用法代碼示例。如果您正苦於以下問題:C# Control類的具體用法?C# Control怎麽用?C# Control使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Control類屬於System.Web.UI命名空間,在下文中一共展示了Control類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FindjQuery

        public static jquerybasic FindjQuery(Control control)
        {
            jquerybasic jquerybasic1 = null;

            if (control is Page) {
                Page thePage = (Page)control;
                foreach (Control c in thePage.Header.Controls) {
                    if (c is jquerybasic) {
                        jquerybasic1 = (jquerybasic)c;
                        break;
                    } else {
                        jquerybasic1 = FindjQuery(c);
                        if (jquerybasic1 != null) {
                            break;
                        }
                    }
                }
            } else {
                foreach (Control c in control.Controls) {
                    if (c is jquerybasic) {
                        jquerybasic1 = (jquerybasic)c;
                        break;
                    } else {
                        jquerybasic1 = FindjQuery(c);
                        if (jquerybasic1 != null) {
                            break;
                        }
                    }
                }
            }

            return jquerybasic1;
        }
開發者ID:ninianne98,項目名稱:CarrotCakeCMS,代碼行數:33,代碼來源:BasicControlUtils.cs

示例2: GridViewTemplate

 public GridViewTemplate(DataControlRowType type, string colNameFr, string colNameDt, Control con)
 {
     templateType = type;
     columnNameFriendly = colNameFr;
     columnNameData = colNameDt;
     control = con;
 }
開發者ID:hoangtung56pm,項目名稱:KPINew,代碼行數:7,代碼來源:GridViewTemplate.cs

示例3: BuildFromDirectory

        private static void BuildFromDirectory(string baseDir, Control level)
        {
            foreach (string idxDir in Directory.GetDirectories(baseDir))
            {
                string dir = idxDir.Replace(baseDir, "");

                // Skipping .svn and similar directories...
                if (dir.IndexOf(".") == 0)
                {
                    continue;
                }
                TreeNode n = new TreeNode {ID = level.ID + dir, Xtra = idxDir, Text = dir};
                level.Controls.Add(n);
                string[] childDirectories = Directory.GetDirectories(idxDir);
                if (childDirectories.Length > 0)
                {
                    // Skipping .svn and similar directories...
                    if (childDirectories.Length == 1)
                    {
                        string tmpDir = childDirectories[0];
                        tmpDir = tmpDir.Substring(tmpDir.LastIndexOf("\\") + 1);
                        if (tmpDir.IndexOf(".") == 0)
                        {
                            continue;
                        }
                    }
                    TreeNodes children = new TreeNodes {ID = "ch" + n.ID};
                    n.Controls.Add(children);
                    BuildFromDirectory(idxDir + "\\", children);
                }
            }
        }
開發者ID:greaterwinner,項目名稱:ra-brix,代碼行數:32,代碼來源:Explorer.ascx.cs

示例4: AddTo

		public override Control AddTo(Control container, PluginContext context)
		{
			var requiredPermission = context.Selected.State == ContentState.Published ? Permission.Publish : Permission.Write;
			if (!context.Engine.SecurityManager.IsAuthorized(context.HttpContext.User, context.Selected, requiredPermission))
				return null;

			if(!ActiveFor(container, context.State)) return null;
			
			if (!context.Selected.VersionOf.HasValue) 
				return base.AddTo(container, context);

			HyperLink hl = new HyperLink();
			hl.Text = GetInnerHtml(context, "{IconsUrl}/cross_orange.png", ToolTip, Title);
			hl.NavigateUrl = Url.Parse("{ManagementUrl}/Content/DiscardPreview.aspx").ResolveTokens()
				.AppendQuery("selectedUrl", context.Selected.Url)
				.AppendQuery(PathData.ItemQueryKey, context.Selected.VersionOf.ID)
				.AppendQuery(PathData.VersionIndexQueryKey, context.Selected.VersionIndex);
			hl.CssClass = "cancel";
			hl.Attributes["onclick"] = "return confirm('Are you certain?');";

			hl.ToolTip = Utility.GetResourceString(GlobalResourceClassName, Name + ".ToolTip") ?? context.Format("Delete this version", false);

			container.Controls.Add(hl);

			return hl;
		}
開發者ID:aiex,項目名稱:n2cms,代碼行數:26,代碼來源:ControlPanelDiscardPreviewOrDeleteAttribute.cs

示例5: CreateMailMessage

 public MailMessage CreateMailMessage(string recipients, IDictionary replacements, Control owner)
 {
     if (owner == null)
     {
         throw new ArgumentNullException("owner");
     }
     string body = string.Empty;
     string bodyFileName = this.BodyFileName;
     if (!string.IsNullOrEmpty(bodyFileName))
     {
         string path = bodyFileName;
         if (!UrlPath.IsAbsolutePhysicalPath(path))
         {
             path = UrlPath.Combine(owner.AppRelativeTemplateSourceDirectory, path);
         }
         TextReader reader = new StreamReader(owner.OpenFile(path));
         try
         {
             body = reader.ReadToEnd();
         }
         finally
         {
             reader.Close();
         }
     }
     return this.CreateMailMessage(recipients, replacements, body, owner);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:27,代碼來源:MailDefinition.cs

示例6: AddTo

		public override Control AddTo(Control container, PluginContext context)
		{
			HtmlGenericControl hgc = new HtmlGenericControl("div");
			hgc.Attributes["class"] = "separator";
			container.Controls.Add(hgc);
			return hgc;
		}
開發者ID:nagarjunachallapalli,項目名稱:n2cms,代碼行數:7,代碼來源:NavigationSeparatorPluginAttribute.cs

示例7: GetEditValue

        /// <summary>
        /// Reads new values entered by the user for the field
        /// </summary>
        /// <param name="control">Parent control that controls were added to in the CreateEditControl() method</param>
        /// <param name="configurationValues"></param>
        /// <returns></returns>
        public override string GetEditValue( Control control, Dictionary<string, ConfigurationValue> configurationValues )
        {
            if ( control != null && control is ListControl )
                return ( (ListControl)control ).SelectedValue;

            return null;
        }
開發者ID:Ganon11,項目名稱:Rock,代碼行數:13,代碼來源:CommunicationTemplateFieldType.cs

示例8: addProperty

        public void addProperty(string Caption, Control C) {
            /*
            tr = new TableRow();
            td = new TableCell();
            td.Text = Caption;
            td.Attributes.Add("width", "15%");
            td.Attributes.Add("valign", "top");
            td.Attributes.Add("class", "propertyHeader");
            tr.Cells.Add(td);
                        
            td = new TableCell();
            td.Attributes.Add("class", "propertyContent");
            td.Controls.Add(C);
            tr.Cells.Add(td);

            tbl.Rows.Add(tr);
            if (!this.Controls.Contains(tbl)) {
                this.Controls.Add(tbl);
            }*/
            PropertyPanel pp = new PropertyPanel();
            pp.Controls.Add(C);
            pp.Text = Caption;

            this.Controls.Add(pp);
        }
開發者ID:CarlSargunar,項目名稱:Umbraco-CMS,代碼行數:25,代碼來源:pane.cs

示例9: AddTo

		public override Control AddTo(ContentItem item, string detailName, Control container)
		{
			Control displayer = (Control)Activator.CreateInstance(ControlType);
			Utility.SetProperty(displayer, ControlPropertyName, item[detailName]);
			container.Controls.Add(displayer);
			return displayer;
		}
開發者ID:navneetccna,項目名稱:n2cms,代碼行數:7,代碼來源:DisplayableAttribute.cs

示例10: TranslateControlText

		private static void TranslateControlText(Control control)
		{
			IEnumerable<IControlTranslator> translators = GetControlTranslators(control);

			foreach (IControlTranslator translator in translators)
				translator.Translate();
		}
開發者ID:jerryshi2007,項目名稱:AK47Source,代碼行數:7,代碼來源:TranslatorControlHelper.cs

示例11: RegisteredExpandoAttribute

		internal RegisteredExpandoAttribute (Control control, string controlId, string name, string value, bool encode) {
			_control = control;
			_name = name;
			_value = value;
			_controlId = controlId;
			_encode = encode;
		}
開發者ID:nobled,項目名稱:mono,代碼行數:7,代碼來源:RegisteredExpandoAttribute.cs

示例12: GetWebValidateBox

 private Control GetWebValidateBox(Control ct)
 {
     if (ct is WebValidate)
     {
         return ct;
     }
     else if (ct.HasControls())
     {
         foreach (Control ctchild in ct.Controls)
         {
             if (ctchild is WebValidate)
             {
                 return ctchild;
             }
             else
             {
                 GetWebValidateBox(ctchild);
             }
         }
         return null;
     }
     else
     {
         return null;
     }
 }
開發者ID:san90279,項目名稱:UK_OAS,代碼行數:26,代碼來源:WebValidateBox.cs

示例13: AddEditor

 protected override Control AddEditor(Control container)
 {
     TimeRange range = new TimeRange {ID = Name + NameEndRange, StartTitle = StartTitle, StartRequired = StartRequired};
     container.Controls.Add(range);
     range.BetweenText = BetweenText;
     return range;
 }
開發者ID:dpawatts,項目名稱:zeus,代碼行數:7,代碼來源:TimeRangeEditorAttribute.cs

示例14: GetModulePanel

        void GetModulePanel(string Panel, string lang)
        {
            ModulesFrontPanelBSO _module = new ModulesFrontPanelBSO();
            DataTable tb = _module.GetModulesFrontPanelbyPanel(Panel, lang);
            string _path = ResolveUrl("~/") + "Client/Modules/MainHome/";
            Control objControl = new Control();


            if (tb.Rows.Count > 0)
            {
                for (int i = 0; i < tb.Rows.Count; i++)
                {
                    //if (tb.Rows[i]["ModulesFrontPanel_Panel"].Equals("Left") || tb.Rows[i]["ModulesFrontPanel_Panel"].Equals("Right"))
                    //    _path += "Client/Modules/Panel/";
                    //else
                    //    if (tb.Rows[i]["ModulesFrontPanel_Panel"].Equals("Main"))
                    //        _path += "Client/Modules/MainHome/";

                    objControl = (Control)this.LoadControl(_path + tb.Rows[i]["ModulesFrontPanel_Url"].ToString());

                    AreaMainPanel.Controls.Add(objControl);
                    ControlParameter(objControl, tb.Rows[i]["ModulesFrontPanel_Title"].ToString(), tb.Rows[i]["ModulesFrontPanel_Icon"].ToString(), tb.Rows[i]["ModulesFrontPanel_Value"].ToString(), Convert.ToInt32(tb.Rows[i]["ModulesFrontPanel_Record"].ToString()));

                }
            }

        }
開發者ID:trungjc,項目名稱:quanlyhocsinh,代碼行數:27,代碼來源:MainHomePage.ascx.cs

示例15: AddLabel

		protected override Label AddLabel(Control container)
		{
			if (string.IsNullOrEmpty(Title))
				return null;
			
			return base.AddLabel(container);
		}
開發者ID:nagarjunachallapalli,項目名稱:n2cms,代碼行數:7,代碼來源:EditableCheckBoxAttribute.cs


注:本文中的System.Web.UI.Control類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。