Ejemplo n.º 1
0
        /// <summary>
        /// 加载对话框的模板
        /// </summary>
        /// <returns></returns>
        protected virtual Control LoadDialogTemplate()
        {
            DialogContentAttribute contentAttr = AttributeHelper.GetCustomAttribute <DialogContentAttribute>(this.GetType());

            var contentHtml = "";

            if (contentAttr != null && string.IsNullOrEmpty(contentAttr.ResourcePath) == false)
            {
                Assembly assembly = Assembly.GetExecutingAssembly();

                if (string.IsNullOrEmpty(contentAttr.AssemblyName) == false)
                {
                    assembly = Assembly.Load(contentAttr.AssemblyName);
                }

                LoadingDialogContentEventArgs e = new LoadingDialogContentEventArgs();

                OnLoadingDialogContent(this, e);

                contentHtml = e.Content;

                if (contentHtml.IsNullOrEmpty())
                {
                    contentHtml = ResourceHelper.LoadStringFromResource(assembly, contentAttr.ResourcePath);
                }
            }

            contentHtml = ReplaceDialogTemplateString(contentHtml);

            return(Page.ParseControl(contentHtml));
        }
Ejemplo n.º 2
0
 protected virtual void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e)
 {
     if (LoadingDialogContent != null)
     {
         LoadingDialogContent(sender, e);
     }
 }
Ejemplo n.º 3
0
 protected override void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e)
 {
     base.OnLoadingDialogContent(sender, e);
 }
Ejemplo n.º 4
0
 protected override void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e)
 {
     base.OnLoadingDialogContent(sender, e);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// 加载对话框的模板
        /// </summary>
        /// <returns></returns>
        protected virtual Control LoadDialogTemplate()
        {
            DialogContentAttribute contentAttr = AttributeHelper.GetCustomAttribute<DialogContentAttribute>(this.GetType());

            var contentHtml = "";

            if (contentAttr != null && string.IsNullOrEmpty(contentAttr.ResourcePath) == false)
            {
                Assembly assembly = Assembly.GetExecutingAssembly();

                if (string.IsNullOrEmpty(contentAttr.AssemblyName) == false)
                    assembly = Assembly.Load(contentAttr.AssemblyName);

                LoadingDialogContentEventArgs e = new LoadingDialogContentEventArgs();

                OnLoadingDialogContent(this, e);

                contentHtml = e.Content;

                if (contentHtml.IsNullOrEmpty())
                    contentHtml = ResourceHelper.LoadStringFromResource(assembly, contentAttr.ResourcePath);

            }

            contentHtml = ReplaceDialogTemplateString(contentHtml);

            return Page.ParseControl(contentHtml);
        }
Ejemplo n.º 6
0
 protected virtual void OnLoadingDialogContent(object sender, LoadingDialogContentEventArgs e)
 {
     if (LoadingDialogContent != null)
         LoadingDialogContent(sender, e);
 }