当前位置: 首页>>代码示例>>C#>>正文


C# UserControl.GetType方法代码示例

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


在下文中一共展示了UserControl.GetType方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterInitializationScripts

 public void RegisterInitializationScripts(UserControl control, params string[] scripts)
 {
     var key = control.GetType().BaseType.Name;
     if (_initializationLines.ContainsKey(key))
         return;
     _initializationLines.Add(key, scripts.ToSeparatedString("\r\n"));
 }
开发者ID:Psolow,项目名称:Umbraco-Public,代码行数:7,代码来源:ModuleScripts.cs

示例2: RegisterStartUpScript

 /// <summary>
 ///     Registers a script near the end of the form only allowed to register Js scripts.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="scriptName">Name of the script.</param>
 /// <param name="script">The script.</param>
 /// <param name="minimized">if set to <c>true</c> [minimized].</param>
 public void RegisterStartUpScript(UserControl control, string scriptName, string script, bool minimized = false)
 {
     Contract.Requires(control != null);
     if (minimized)
     {
         script = this.MinimizeJsCode(script);
     }
     control.Page.ClientScript.RegisterStartupScript(control.GetType(), scriptName,
         string.Format("<script>{0}</script>", script));
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:17,代码来源:ClientProviders.cs

示例3: OnInit

		protected override void OnInit(EventArgs e)
		{
			base.OnInit (e);

            Control oControl = new System.Web.UI.UserControl().LoadControl(_usercontrolPath);

            if (HasSettings(oControl.GetType()))
            {
                DataEditorSettingsStorage ss = new DataEditorSettingsStorage();
                List<Setting<string, string>> s = ss.GetSettings(((umbraco.cms.businesslogic.datatype.DefaultData)_data).DataTypeDefinitionId);
                ss.Dispose();

                foreach (Setting<string, string> setting in s)
                {
                    try
                    {
                        if(!string.IsNullOrEmpty(setting.Key))
                        {
                            oControl.GetType().InvokeMember(setting.Key, System.Reflection.BindingFlags.SetProperty, null, oControl, new object[] { setting.Value });
                        }

                    }
                    catch (MissingMethodException) { }
                }
                
            }

            // Add property data to the usercontrol if it supports it
            // TODO: Find the best way to test for an interface!
		    IUsercontrolPropertyData propertyData = oControl as IUsercontrolPropertyData;
            if (propertyData != null)
            {
                propertyData.PropertyObject = new Property(((usercontrolData)_data).PropertyId);
            }

            this.Controls.Add(oControl);

            if (!Page.IsPostBack)
                ((IUsercontrolDataEditor)Controls[0] as IUsercontrolDataEditor).value = _data.Value;
              
		}
开发者ID:phaniarveti,项目名称:Experiments,代码行数:41,代码来源:usercontrolDataEditor.cs

示例4: SetPropertyValues

 public static void SetPropertyValues(UserControl control, HttpContext context)
 {
     var metadata = GetMetadata(control.GetType());
     foreach (var property in metadata.Keys)
     {
         object value = GetValue(metadata[property], context) ?? GetDefaultValue(property);
         if (value != null)
         {
             property.SetValue(control, Convert.ChangeType(value, property.PropertyType), null);
         }
     }
 }
开发者ID:xxfss2,项目名称:MyLibrary,代码行数:12,代码来源:SelectPropertyMetaDataProc.cs

示例5: Hide

 /// <summary>
 ///     Hides the specified u.
 /// </summary>
 /// <param name="u">The u.</param>
 public static void Hide(UserControl u)
 {
     u.Page.ClientScript.RegisterClientScriptBlock(u.GetType(), "busyindicatorhide",
         "sap.ui.core.BusyIndicator.hide();", true);
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:9,代码来源:BusyIndicator.cs

示例6: InitializeUserControl

            private void InitializeUserControl(UserControl instance)
            {
                if (!this.alreadyInitializedControls.Contains(instance))
                {
                    // ASP.NET creates a sub type for UserControls with all the mark up, but this is not the  
                    // type that a user can register and not always a type that can be initialized.
                    Type type = instance.GetType().BaseType;

                    this.InitializeInstance(type, instance);

                    // Ensure every user control is only initialized once.
                    this.alreadyInitializedControls.Add(instance);
                }
            }
开发者ID:MichaelSagalovich,项目名称:SimpleInjector,代码行数:14,代码来源:SimpleInjectorWebFormsHttpModule.cs

示例7: RegisterClientScriptBlock

 /// <summary>
 ///     Registers a Js Script at the header of a page. Can use minimization and external files based on parameters passed
 ///     to function.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="scriptName">Name of the script.</param>
 /// <param name="script">The script.</param>
 /// <param name="minimized">if set to <c>true</c> [minimized].</param>
 /// <param name="isExternalFile">if set to <c>true</c> [is external file].</param>
 public void RegisterClientScriptBlock(UserControl control, string scriptName, string script,
     bool minimized = false, bool isExternalFile = false)
 {
     Contract.Requires(control != null);
     if (minimized)
     {
         script = this.MinimizeJsCode(script);
     }
     if (isExternalFile)
     {
         //TODO: verifiy map path
         script = File.ReadAllText(this.RapContext.MapPath(script));
     }
     control.Page.ClientScript.RegisterClientScriptBlock(control.GetType(), scriptName,
         string.Format("<script>{0}</script>", script));
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:25,代码来源:ClientProviders.cs

示例8: RegisterRawScript

 /// <summary>
 ///     Registers a raw external css or js file.  This should be used if the file is already minimized
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="scriptName">Name of the script.</param>
 /// <param name="rawScript">The raw script.</param>
 public void RegisterRawScript(UserControl control, string scriptName, string rawScript)
 {
     Contract.Requires(control != null);
     control.Page.ClientScript.RegisterClientScriptBlock(control.GetType(), scriptName,
         string.Format("{0}", rawScript));
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:12,代码来源:ClientProviders.cs

示例9: DisplayRealTimeSuccess

 /// <summary>
 /// Displays the real time success.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="content">The content.</param>
 public void DisplayRealTimeSuccess(UserControl control, string content)
 {
     control.Page.ClientScript.RegisterStartupScript(control.GetType(), "alertifySuccess",
         "alertify.success('{0}')".FormatWith(content), true);
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:10,代码来源:ClientProviders.cs

示例10: DisplayRealTimeError

 /// <summary>
 /// Displays the real time error.
 /// </summary>
 /// <param name="control">The control.</param>
 /// <param name="content">The content.</param>
 public void DisplayRealTimeError(UserControl control, string content)
 {
     control.Page.ClientScript.RegisterStartupScript(control.GetType(), "alertifyError",
         "alertify.error('"+ content + "')", true);
 }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:10,代码来源:ClientProviders.cs

示例11: DisplayRealTimeNotification

        /// <summary>
        /// Displays the real time notification.
        /// </summary>
        /// <param name="control">The control.</param>
        /// <param name="content">The content.</param>
        public void DisplayRealTimeNotification(UserControl control, string content)
        {
            control.Page.ClientScript.RegisterStartupScript(control.GetType(), "alertifyNotification",
                "alertify.log('{0}')".FormatWith(content), true);

        }
开发者ID:asebak,项目名称:rapbattleonline,代码行数:11,代码来源:ClientProviders.cs


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