• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UI.Control类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Web.UI.Control的典型用法代码示例。如果您正苦于以下问题:C# Control类的具体用法?C# Control怎么用?C# Control使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Control类属于System.Web.UI命名空间,在下文中一共展示了Control类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: AddTo

        public override Control AddTo(Control container, PluginContext context)
        {
            var selector = context.Engine.Resolve<LanguageGatewaySelector>();
            if (!selector.Enabled || selector.LanguagesPerSite /*avoid showing options that might not be relevant */)
                return null;

            ILanguageGateway gateway = selector.GetAllLanguages();

            HtmlGenericControl div = new HtmlGenericControl("div");
            div.Attributes["class"] = "languages";
            container.Controls.Add(div);

            base.AddTo(div, context);

            foreach (ILanguage language in gateway.GetAvailableLanguages())
            {
                Url url = Engine.ManagementPaths.ResolveResourceUrl("{ManagementUrl}/Content/Globalization/Translate.aspx");
                url = url.AppendQuery("language", language.LanguageCode);
                url = url.AppendQuery(SelectionUtility.SelectedQueryKey + "={selected}");

                HyperLink h = new HyperLink();
                h.ID = language.LanguageCode.Replace('-', '_').Replace(' ', '_');
                h.Target = Targets.Preview;
                h.NavigateUrl = context.Rebase(context.Format(url, true));
                h.CssClass = "templatedurl language";
                h.ToolTip = language.LanguageTitle;
                h.Text = string.Format("<img src='{0}' alt=''/>", Url.ToAbsolute(language.FlagUrl));
                h.Attributes["data-url-template"] = context.Rebase(url);
                div.Controls.Add(h);
            }

            return div;
        }
开发者ID:GrimaceOfDespair,项目名称:n2cms,代码行数:33,代码来源:NavigationTranslationsPluginAttribute.cs


示例17: ControlWasPostedBack

        public static bool ControlWasPostedBack(Page page, Control target)
        {
            bool result = false;

            string ctlName = page.Request.Params.Get("__EVENTTARGET");

            if (ctlName != null && ctlName != string.Empty)
            {
                if (ctlName.Contains(target.ID))
                {
                    result = true;
                }
            }
            else
            {
                foreach (string ctl in page.Request.Form)
                {
                    if (ctl.Contains(target.ID))
                    {
                        result = true;
                        break;
                    }
                }
            }

            return result;
        }
开发者ID:vorman,项目名称:WebStats,代码行数:27,代码来源:Utility.cs


示例18: LoadWidgets

        public void LoadWidgets(IEnumerable<Widget> widgetModels, Control placeholder, TemplateControl page)
        {
            if (placeholder == null)
            {
                return;
            }

            if (page == null)
            {
                return;
            }

            if (widgetModels == null)
            {
                return;
            }

            var groups = widgetModels.OrderBy(x => x.RowNumber).ThenBy(x => x.ColumnNumber).GroupBy(x => new {x.RowNumber});

            foreach (var group in groups)
            {
                foreach (Widget item in group)
                {
                    using (MixERPWidgetBase widget = page.LoadControl(item.WidgetSource) as MixERPWidgetBase)
                    {
                        if (widget != null)
                        {
                            placeholder.Controls.Add(widget);
                            widget.OnControlLoad(widget, new EventArgs());
                        }
                    }
                }
            }
        }
开发者ID:JonathanValle,项目名称:mixerp,代码行数:34,代码来源:Index.aspx.cs


示例19: CreateItems

        protected override void CreateItems(Control container)
        {
            if (State.IsFlagSet(ControlPanelState.DragDrop) && (AllowExternalManipulation || CurrentItem == CurrentPage || Find.ClosestPage(CurrentItem) == CurrentPage))
            {
                if (ZoneName.IndexOfAny(new[] {'.', ',', ' ', '\'', '"', '\t', '\r', '\n'}) >= 0) throw new N2Exception("Zone '" + ZoneName + "' contains illegal characters.");

                Panel zoneContainer = AddPanel(this, ZoneName + " dropZone");
				if (CurrentItem.ID != 0 && !CurrentItem.VersionOf.HasValue)
				{
					zoneContainer.Attributes["data-id"] = CurrentItem.ID.ToString();
					zoneContainer.Attributes[PartUtilities.PathAttribute] = CurrentItem.Path;
				}
				else
				{
					zoneContainer.Attributes[PartUtilities.PathAttribute] = Find.ClosestPage(CurrentItem).Path;
					zoneContainer.Attributes["data-versionKey"] = CurrentItem.GetVersionKey();
					zoneContainer.Attributes["data-versionIndex"] = CurrentItem.VersionIndex.ToString();
				}
                zoneContainer.Attributes[PartUtilities.ZoneAttribute] = ZoneName;
                zoneContainer.Attributes[PartUtilities.AllowedAttribute] = PartUtilities.GetAllowedNames(ZoneName, PartsAdapter.GetAllowedDefinitions(CurrentItem, ZoneName, Page.User));
                
                zoneContainer.ToolTip = GetToolTip(GetDefinition(CurrentItem), ZoneName);
                base.CreateItems(zoneContainer);
            }
            else
            {
                base.CreateItems(this);
            }
        }
开发者ID:nikita239,项目名称:Aspect,代码行数:29,代码来源:DroppableZone.cs


示例20: InstantiateIn

			public void InstantiateIn(Control container)
			{
				Literal l = new Literal();
				l.Text = "<div>";
				l.DataBinding += new EventHandler(this.BindData);
				container.Controls.Add(l);
			}
开发者ID:nobled,项目名称:mono,代码行数:7,代码来源:Repeater_ItemTemplate.aspx.cs



注:本文中的System.Web.UI.Control类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UI.ControlBuilder类代码示例发布时间:2022-05-26
下一篇:
C# UI.BoundPropertyEntry类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap