Example #1
0
        private void BindTabs()
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.Ibn.WebResources.App_GlobalResources.Admin.Resources.strDefault", Assembly.Load(new AssemblyName("Mediachase.Ibn.WebResources")));

            UserLightPropertyCollection pc;

            pc = Security.CurrentUser.Properties;

            if (Tab != null)
            {
                if (Tab == "PortalSetup" || Tab == "Dictionaries" || Tab == "RoutingWorkflow" ||
                    Tab == "Customization" || Tab == "Reports" || Tab == "BusinessData" ||
                    Tab == "CommonSettings" || Tab == "HelpDesk" || Tab == "FilesForms" ||
                    Tab == "AddTools")
                {
                    pc["Admin_CurrentTab"] = Tab;
                }
            }
            else if (pc["Admin_CurrentTab"] == null)
            {
                pc["Admin_CurrentTab"] = "PortalSetup";
            }

            string controlName = "~/admin/modules/default.ascx";

            if (pc["Admin_CurrentTab"] == "Reports")
            {
                controlName = "~/admin/modules/AdminReports.ascx";
                ((Mediachase.UI.Web.Modules.PageTemplateNew) this.Parent.Parent.Parent.Parent).Title = LocRM.GetString("tReport");
            }

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
        }
        private void BindTabs()
        {
            if (Tab != null && (Tab == "PrjGrp" || Tab == "PrjPhase" || Tab == "PrjMan"))
            {
                pc["ActivitiesTracking_CurrentTab"] = Tab;
            }
            else if (pc["ActivitiesTracking_CurrentTab"] == null)
            {
                pc["ActivitiesTracking_CurrentTab"] = "PrjGrp";
            }

            string controlName = "";

            if (pc["ActivitiesTracking_CurrentTab"] == "PrjGrp")
            {
                secHeader.Title = LocRM.GetString("tActTrackPrjByPrjGrp");
                controlName     = "~/Projects/Modules/ActivitiesByPrjGroup.ascx";
            }
            else if (pc["ActivitiesTracking_CurrentTab"] == "PrjPhase")
            {
                secHeader.Title = LocRM.GetString("tActTrackPrjByPrjPhase");
                controlName     = "~/Projects/Modules/ActivitiesByPhase.ascx";
            }
            else if (pc["ActivitiesTracking_CurrentTab"] == "PrjMan")
            {
                secHeader.Title = LocRM.GetString("tActTrackPrjByPrjMan");
                controlName     = "~/Projects/Modules/ActivitiesByManager.ascx";
            }

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
        }
        /// <summary>
        /// Constructor parses parameters and applies properties as directed.
        /// </summary>
        /// <param name="control">Pass "this" from the user control</param>
        /// <param name="applyProperties">Set user control properties corresponding to parameter names to parameter values.</param>

        public SublayoutParamHelper(System.Web.UI.UserControl control, bool applyProperties)
        {
            _sublayout = control.Parent as Sitecore.Web.UI.WebControls.Sublayout;
            //Sitecore.Links.LinkManager.GetItemUrl

            // Parse parameters passed to the sc:sublayout control.

            if (_sublayout != null)
            {
                _params = Sitecore.Web.WebUtil.ParseUrlParameters(_sublayout.Parameters);

                if (applyProperties)
                {
                    foreach (string key in _params.Keys)
                    {
                        Sitecore.Reflection.ReflectionUtil.SetProperty(control, key, _params[key]);
                    }

                    if (_dataSource != null)
                    {
                        Sitecore.Reflection.ReflectionUtil.SetProperty(control, "datasource", DataSourceItem.Paths.FullPath);
                        Sitecore.Reflection.ReflectionUtil.SetProperty(control, "datasourceitem", DataSourceItem);
                    }
                }
            }
        }
        protected void SelfRegister(System.Web.UI.UserControl control)
        {
            if (control != null && control is IView)
            {
                object[] attributes = control.GetType().GetCustomAttributes(typeof(PresenterTypeAttribute), true);

                if (attributes != null && attributes.Length > 0)
                {
                    foreach (Attribute viewAttribute in attributes)
                    {
                        if (viewAttribute is PresenterTypeAttribute)
                        {
                            //Had to grab the application context that gets created in the global.asax and shoved into the httpcontext.current.items collection.  In order to use it I have to assign it to the ISessionProvider because presenters have no knowledge of httpcontext.
                            var sessionProvider = new WebSessionProvider();
                            SessionManager.Current = sessionProvider;
                            //if (HttpContext.Current.Items[ResourceStrings.Session_ApplicationContext] != null)
                            //{
                            //    SessionManager.Current[ResourceStrings.Session_ApplicationContext] = (ApplicationContext)HttpContext.Current.Items[ResourceStrings.Session_ApplicationContext];
                            //}
                            PresentationManager.RegisterView((viewAttribute as PresenterTypeAttribute).PresenterType, control as IView, sessionProvider);

                            if (SecurityContextManager.Current == null)
                            {
                                SecurityContextManager.Current = new WebSecurityContext();
                            }
                            break;
                        }
                    }
                }
            }
        }
Example #5
0
 /// <summary>
 /// Busca los elementos negados al usuario (por perfil activo y usuario) para el recurso señalado
 /// </summary>
 /// <param name="control_usuario">Referencia del recurso por proteger</param>
 /// <param name="id_usuario">Id de usuario al que se configurará</param>
 public static void AplicaSeguridadControlusuarioWeb(System.Web.UI.UserControl control_usuario, int id_usuario)
 {
     //Instanciando recurso (forma o control de usuario)
     using (Forma f = new Forma(control_usuario.AppRelativeVirtualPath))
     {
         //Si la forma existe
         if (f.habilitar)
         {
             //Cargando elementos negados al usuario señalado
             using (DataTable mit = ControlPerfilUsuario.CargaControlesNegadosUsuario(id_usuario, f.id_forma))
             {
                 //Si hay elementos por proteger ante el usuario
                 if (mit != null)
                 {
                     //Para cada uno de los controles que serán negados
                     foreach (string nombre_control in (from DataRow r in mit.Rows
                                                        select r["Nombre"].ToString()))
                     {
                         //Para Cada control de interés
                         foreach (System.Web.UI.Control control in control_usuario.Controls)
                         {
                             //Aplicando seguridad
                             aplicaSeguridadControl(nombre_control, control, f.tipo_recurso);
                         }
                     }
                 }
             }
         }
     }
 }
Example #6
0
        /// <summary>
        /// 设置网面包屑
        /// </summary>
        /// <param name="value">格式为[钻戒:/Product/,男戒:/Product/Man-Rings.htm|心若夏花]</param>
        public void CrumbRegister(string value)
        {
            StringBuilder NodeList = new StringBuilder();

            string[] Crumb = value.Split('|');
            if (Crumb.Length > 1)
            {
                string[] Nodes = Crumb[0].Split(',');
                string[] _Node = new string[1];
                NodeList.Append("<span>&raquo;</span>");
                foreach (string Node in Nodes)
                {
                    _Node = Node.Split(':');
                    NodeList.Append("<a href=\"" + _Node[1] + "\" title=\"" + _Node[0] + "\">" + _Node[0] + "</a><span>&raquo;</span>");
                }
                NodeList.Append("<em>" + Crumb[1] + "</em>");
                value = NodeList.ToString();
            }
            else
            {
                value = "<span>&raquo;</span>" + value;
            }
            System.Web.UI.UserControl CrumbContainer = this.Master.Master.FindControl("ContainerPlaceHolder").FindControl("CrumbContainer") as System.Web.UI.UserControl;
            Literal ltCrumbContainer = CrumbContainer.FindControl("ltCrumbContainer") as Literal;

            ltCrumbContainer.Text = value;
        }
Example #7
0
        private void BindTabs()
        {
            UserLightPropertyCollection pc = Security.CurrentUser.Properties;

            if (Tab != null && (Tab == "0" || Tab == "1" || Tab == "2"))
            {
                pc[pcKey] = Tab;
            }
            else if (pc[pcKey] == null)
            {
                pc[pcKey] = "1";
            }

            if (TypeId < 0)
            {
                ctrlTopTab.AddTab(LocRM.GetString("tFileStorage"), "0");
            }
            else if (pc[pcKey] == "0")
            {
                pc[pcKey] = "1";
            }
            ctrlTopTab.AddTab(LocRM.GetString("tFileList"), "1");
            ctrlTopTab.AddTab(LocRM.GetString("tSearch"), "2");

            string controlName = "";
            string selectedTab = pc[pcKey];

            if (!IsPostBack)
            {
                switch (selectedTab)
                {
                case "0":
                    controlName = "../../FileStorage/Modules/FileStorageControl.ascx";
                    break;

                case "1":
                    controlName = "../../FileStorage/Modules/FilesList.ascx";
                    break;

                case "2":
                    controlName = "../../FileStorage/Modules/FileSearch.ascx";
                    break;

                default:
                    break;
                }
                ViewState["controlName"] = controlName;
                ViewState["selectedTab"] = selectedTab;
            }
            else
            {
                controlName = (string)ViewState["controlName"];
                selectedTab = (string)ViewState["selectedTab"];
            }

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
            ctrlTopTab.SelectItem(selectedTab);
        }
        private void ddSource_SelectedIndexChanged(object sender, EventArgs e)
        {
            phMap.Controls.Clear();
            string controlName = EMailIncidentMappingHandler.Load(int.Parse(ddSource.SelectedValue)).UserControl;

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phMap.Controls.Add(control);
        }
Example #9
0
 /// <summary>
 /// Get the template associated with the specified node
 /// </summary>
 /// <param name="n">Node you want to load the template from</param>
 /// <returns>UserControl</returns>
 public static System.Web.UI.Control GetAdminTemplate(Node n)
 {
     System.Web.HttpContext    context = System.Web.HttpContext.Current;
     System.Web.UI.UserControl c       = new System.Web.UI.UserControl();
     if (n == null)
     {
         context.Response.Redirect(context.Request.RawUrl.Substring(0, context.Request.RawUrl.IndexOf("?")));
     }
     return(c.LoadControl("~/" + SFGlobal.NodeTemplateLocation + "/" + Templates.getByID(n.TypeID).AdminTemplate + ".ascx"));;
 }
Example #10
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     System.Web.UI.Control u = new System.Web.UI.UserControl().LoadControl(SystemDirectories.Umbraco + "/controls/genericProperties/GenericProperty.ascx");
     u.ID = this.ID + "_control";
     ((GenericProperty)u).Delete += new EventHandler(GenericPropertyWrapper_Delete);
     ((GenericProperty)u).FullId  = _fullId;
     this.Controls.Add(u);
     UpdateEditControl();
 }
Example #11
0
        private void BindTabs()
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.UI.Web.App_GlobalResources.Reports.Resources.strReports", typeof(DefaultReports).Assembly);

            UserLightPropertyCollection pc;

            pc = Security.CurrentUser.Properties;

            if (Tab != null)
            {
                if (Tab == "Dashboard" || Tab == "Administrative")
                {
                    pc["Reports_CurrentTab"] = Tab;
                }
            }
            else if (pc["Reports_CurrentTab"] == null)
            {
                pc["Reports_CurrentTab"] = "Dashboard";
            }

            ctrlTopTab.AddTab(LocRM.GetString("Dashboard"), "Dashboard");

            if (Security.IsUserInGroup(InternalSecureGroups.Administrator))
            {
                ctrlTopTab.AddTab(LocRM.GetString("Administrative"), "Administrative");
            }
            else if (pc["Reports_CurrentTab"] == "Administrative")
            {
                pc["Reports_CurrentTab"] = "Dashboard";
            }

            ctrlTopTab.TabWidth = "130px";
            ctrlTopTab.SelectItem(pc["Reports_CurrentTab"]);

            string controlName = String.Empty;

            if (pc["Reports_CurrentTab"] == "Administrative")
            {
                controlName = "~/Admin/modules/AdminReports.ascx";
            }
            else
            {
                controlName = "~/reports/modules/dashboard.ascx";
                if (!String.IsNullOrEmpty(Mediachase.IBN.Business.PortalConfig.ManagementCenterDashboardControl) &&
                    File.Exists(Server.MapPath(Mediachase.IBN.Business.PortalConfig.ManagementCenterDashboardControl)))
                {
                    controlName = Mediachase.IBN.Business.PortalConfig.ManagementCenterDashboardControl;
                }
            }

            String tab = pc["Reports_CurrentTab"];

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
        }
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindList();
            }
            string controlName = EMailIncidentMappingHandler.Load(int.Parse(ddSource.SelectedValue)).UserControl;

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phMap.Controls.Add(control);
        }
Example #13
0
 public static void ShowAlert(this System.Web.UI.UserControl page, string message)
 {
     try
     {
         page.Parent.Page.ShowAlert(message);
     }
     catch (Exception ee)
     {
         Utils.Write(ee);
     }
 }
Example #14
0
        /// <summary>
        /// Registers an external script url on this page.
        /// </summary>
        /// <param name="location">Specifies whether the script should be added to the page header. If False, it will be added to the </param>
        public static void RegisterScriptFile(this System.Web.UI.UserControl module, string scriptUrl, ScriptInsertLocation location = ScriptInsertLocation.FormBottom)
        {
            var mSharpPage = module.Page as MSharp.Framework.UI.Page;

            if (mSharpPage == null)
            {
                throw new InvalidOperationException("The page of this module is not MSharp.Framework.UI.Page.");
            }

            mSharpPage.RegisterScriptFile(scriptUrl, location);
        }
Example #15
0
        public System.Web.UI.Control RenderPortletTable(bool enableEdit)
        {
            System.Web.UI.UserControl uc = new System.Web.UI.UserControl();
            //            string displayURL = string.Format("~/Portlets/{0}/{1}", _portletInstance.Portlet.Id, _portletInstance.Portlet.DisplayFileName);
            PortletControl result = (PortletControl)uc.LoadControl(_portletInstance.Portlet.DisplayURL);

            //result.ID = string.Format("portlet{0}{1}{2}", _parent.Parent.Panel.Id, _order, _name);
            result.ID         = string.Format("portlet_{0}", _portletInstance.Id);
            result.Portlet    = this;
            result.EnableEdit = enableEdit;
            return(result);
        }
Example #16
0
        public static void SetPropertyByName(string controlPropName, System.Web.UI.UserControl control, string val)
        {
            PropertyInfo[] propertyInfos = control.GetType().GetProperties();

            foreach (PropertyInfo propertyInfo in propertyInfos)
            {
                if (propertyInfo.CanRead && propertyInfo.Name == controlPropName)
                {
                    propertyInfo.SetValue(control, val, null);
                    break;
                }
            }
        }
Example #17
0
 public static void ForceNoIE9CompatibilityMode(System.Web.UI.UserControl control)
 {
     if (IsBrowserIE)
     {
         //Meta tag to force IE9 out of compatability mode
         HtmlMeta metaDescription = new HtmlMeta()
         {
             HttpEquiv = "X-UA-Compatible",
             Content   = "IE=9"
         };
         control.Page.Header.Controls.AddAt(0, metaDescription);
     }
 }
Example #18
0
        public System.Web.UI.Control RenderPortletDiv(bool enableEdit)
        {
            System.Web.UI.UserControl uc = new System.Web.UI.UserControl();

            // ham nay load usercontrol(porlet) theo duong dan trong class RenderTitlePorletInDiv

            PortletControl result = (PortletControl)uc.LoadControl(_portletInstance.Portlet.DisplayURL);

            result.ID         = string.Format("psc-portlet-{0}", _portletInstance.Id);
            result.Portlet    = this;
            result.EnableEdit = enableEdit;
            return(result);
        }
Example #19
0
        /// <summary>To HTML from user control file (ascx).</summary>
        public static string ToHtml(System.Web.UI.UserControl uc)
        {
            System.IO.StringWriter       sw     = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter writer = new System.Web.UI.HtmlTextWriter(sw);
            string contents = String.Empty;

            //try {
            uc.RenderControl(writer);
            contents = sw.ToString();
            //} catch {
            //    return "HTML Conversion Error";
            //}
            return(contents);
        }
Example #20
0
        public void ProcessRequest(HttpContext context)
        {
            if (!Global.IdUser.HasValue)
            {
                context.Response.Write("ERROR_SESSION");
                return;
            }

            System.Web.UI.Page        pageHolder  = new System.Web.UI.Page();
            System.Web.UI.UserControl viewControl = (System.Web.UI.UserControl)pageHolder.LoadControl(context.Request.Params["Page"]);

            pageHolder.Controls.Add(viewControl);
            StringWriter result = new StringWriter();

            HttpContext.Current.Server.Execute(pageHolder, result, false);
            context.Response.Write(result.ToString());
        }
Example #21
0
        public void BindTabs()
        {
            foreach (TabItem ti in tabItems)
            {
                if (ti.Selected)
                {
                    secHeader.AddText(ti.Text);

                    System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(ti.Control);
                    phItems.Controls.Add(control);
                }
                else
                {
                    secHeader.AddLeftLink(ti.Text, ti.Link);
                }
            }
        }
Example #22
0
        public static string paging(string url, string para, int sumpage, int page, System.Web.UI.UserControl myPaging)
        {
            myPaging.Visible = false;
            string result = string.Empty;

            if (sumpage == 1)
            {
                return(result);
            }
            if (sumpage > 500)
            {
                sumpage = 500;
            }
            if (page > sumpage)
            {
                page = 1;
            }
            StringBuilder sb = new StringBuilder();

            if (sumpage > 0)
            {
                myPaging.Visible = true;
                switch (page)
                {
                case 1:
                    sb.Append(string.Format("<a href=\"{0}?page={1}{2}\">{3}</a> ", new object[] { url, page + 1, para, "下一页" }));
                    break;

                default:
                    if (sumpage == page)
                    {
                        sb.Append(string.Format("<a href=\"{0}?page={1}{2}\">{3}</a> ", new object[] { url, page - 1, para, "上一页" }));
                    }
                    else
                    {
                        sb.Append(string.Format("<a href=\"{0}?page={1}{2}\">{3}</a> <a href=\"{4}?page={5}{6}\">{7}</a> ",
                                                new object[] { url, page + 1, para, "下一页", url, page - 1, para, "上一页" }));
                    }
                    break;
                }
                sb.Append(string.Format("第{0}/{1}页", new object[] { page, sumpage }));
            }
            return(sb.ToString());
        }
Example #23
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            iconIBN.Href = Page.ResolveUrl("~/portal.ico");
            RegisterScripts();

            Response.Cache.SetNoStore();
            mainForm.Enctype = this.Enctype;
            iconIBN.Href     = ResolveUrl("~/portal.ico");

            if (controlName != "")
            {
                System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
                foreach (DictionaryEntry de in controlProperties)
                {
                    control.GetType().BaseType.GetProperty(de.Key.ToString()).SetValue(control, de.Value, null);
                }
                phMain.Controls.Add(control);
            }
        }
        protected void SelfRegister(System.Web.UI.UserControl control)
        {
            if (control != null && control is IView)
            {
                object[] attributes = control.GetType().GetCustomAttributes(typeof(PresenterTypeAttribute), true);

                if (attributes != null && attributes.Length > 0)
                {
                    foreach (Attribute viewAttribute in attributes)
                    {
                        if (viewAttribute is PresenterTypeAttribute)
                        {
                            PresentationManager.RegisterView((viewAttribute as PresenterTypeAttribute).PresenterType, control as IView, new WebSessionProvider(), new WebSecurityContext());
                            break;
                        }
                    }
                }
            }
        }
Example #25
0
        private void BindTabs()
        {
            string curTab = Tab;

            if (curTab == null)
            {
                curTab = "0";
            }

            ctrlTopTab.AddTab("Administration", "0");
            ctrlTopTab.AddTab("Reports", "1");
            //			ctrlTopTab.AddTab("Billing/Commissions","2");
            ///ctrlTopTab.AddTab("Customer Support","3");
            ctrlTopTab.AddTab("Tariffs", "4");
            ctrlTopTab.TabWidth = "150px";

            ctrlTopTab.SelectItem(curTab);

            string controlName = "";

            switch (curTab)
            {
            case "1":
                controlName = "Reports.ascx";
                break;

            /*case "2":
             *      controlName = "Billing.ascx";
             *      break;
             * case "3":
             *      controlName = "CustomerSupport.ascx";
             *      break;*/
            case "4":
                controlName = "Tariffs.ascx";
                break;

            default:
                controlName = "ASPHome.ascx";
                break;
            }
            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
        }
Example #26
0
 void KiAYycU(System.Windows.Forms.ControlBindingsCollection pZV)
 {
     System.MulticastNotSupportedException               AJhU    = new System.MulticastNotSupportedException();
     System.Diagnostics.EventSourceCreationData          jrL     = new System.Diagnostics.EventSourceCreationData("LNXJViQYeD", "PlPopATuddjRpXhL");
     System.Net.Configuration.SmtpNetworkElement         YSVyOwQ = new System.Net.Configuration.SmtpNetworkElement();
     System.Web.UI.WebControls.ObjectDataSourceEventArgs vbfdYu  = new System.Web.UI.WebControls.ObjectDataSourceEventArgs(741789051);
     System.Web.UI.UserControl       wMPBQx = new System.Web.UI.UserControl();
     System.CodeDom.CodeMemberMethod vcwhlo = new System.CodeDom.CodeMemberMethod();
     System.Collections.Specialized.StringCollection UALiy               = new System.Collections.Specialized.StringCollection();
     System.Net.WebHeaderCollection                   ozl                = new System.Net.WebHeaderCollection();
     System.IO.DirectoryInfo                          EyPh               = new System.IO.DirectoryInfo("DoR");
     System.Web.UI.WebControls.TreeNode               HmKhJb             = new System.Web.UI.WebControls.TreeNode("TuassxbuxS");
     System.Windows.Forms.ToolTip                     ztYHQI             = new System.Windows.Forms.ToolTip();
     System.Web.UI.WebControls.ProfileParameter       nLdht              = new System.Web.UI.WebControls.ProfileParameter();
     System.Diagnostics.DebuggerStepThroughAttribute  qkHSHOS            = new System.Diagnostics.DebuggerStepThroughAttribute();
     System.Web.Configuration.ProfilePropertySettings tCq                = new System.Web.Configuration.ProfilePropertySettings("YRcXFmyMDBbtT");
     System.Windows.Forms.LinkLabel                   OZYgod             = new System.Windows.Forms.LinkLabel();
     System.Runtime.CompilerServices.FixedAddressValueTypeAttribute bOMB = new System.Runtime.CompilerServices.FixedAddressValueTypeAttribute();
     System.IO.EndOfStreamException Gvby = new System.IO.EndOfStreamException();
 }
Example #27
0
        /// <summary>
        /// Initializes a new instance of the SublayoutParameterHelper class. Parses
        /// parameters and applies properties as directed.
        /// </summary>
        /// <param name="control">Pass "this" from the user control</param>
        /// <param name="applyProperties">Set user control properties corresponding to
        /// parameter names to parameter values.</param>
        public SublayoutParameterHelper(System.Web.UI.UserControl control, bool applyProperties)
        {
            this.BindingControl = control.Parent as Sublayout;
            // Parse parameters passed to the sc:sublayout control.
            if (this.BindingControl != null)
            {
                this.Parameters = WebUtil.ParseUrlParameters(this.BindingControl.Parameters);
                if (applyProperties)
                {
                    this.ApplyProperties(control);
                }
            }

            Placeholder placeholder = WebUtil.FindAncestorOfType(control, typeof(Placeholder), false) as Placeholder;

            if (placeholder != null)
            {
                this.PlaceholderParameters = WebUtil.ParseUrlParameters(placeholder.Parameters);
            }
        }
        /// <summary>
        /// Initializes a new instance of the SublayoutParameterHelper class. Parses
        /// parameters and applies properties as directed.
        /// </summary>
        /// <param name="control">Pass "this" from the user control</param>
        /// <param name="applyProperties">Set user control properties corresponding to
        /// parameter names to parameter values.</param>
        public SublayoutParameterHelper(
            System.Web.UI.UserControl control,
            bool applyProperties)
        {
            this.BindingControl = control.Parent as Sitecore.Web.UI.WebControls.Sublayout;

            // Parse parameters passed to the sc:sublayout control.
            if (this.BindingControl == null)
            {
                return;
            }

            this.Parameters = Sitecore.Web.WebUtil.ParseUrlParameters(
                this.BindingControl.Parameters);

            if (applyProperties)
            {
                this.ApplyProperties(control);
            }
        }
Example #29
0
        private static string getHttpFullPath(System.Web.UI.UserControl page)
        {
            string h = "http://" + page.Request.Url.Host + page.Request.ApplicationPath;

            if (page != null &&
                page.Request != null &&
                page.Request.Url != null &&
                page.Request.Url.Host != null)
            {
                if (!page.Request.Url.Port.Equals(80))
                {
                    h = page.Request.Url.Scheme + "://" + page.Request.Url.Host + ":" + page.Request.Url.Port + page.Request.ApplicationPath;
                }
                else
                {
                    h = page.Request.Url.Scheme + "://" + page.Request.Url.Host + page.Request.ApplicationPath;
                }
            }

            return(h);
        }
Example #30
0
        private void BindTabs()
        {
            ResourceManager LocRM = new ResourceManager("Mediachase.Ibn.WebResources.App_GlobalResources.Calendar.Resources.strCalendar", Assembly.Load(new AssemblyName("Mediachase.Ibn.WebResources")));

            UserLightPropertyCollection pc = Security.CurrentUser.Properties;

            if (Tab != null)
            {
                if (Tab == "SharedCalendars" || Tab == "MyCalendar")
                {
                    pc["Calendar1_CurrentTab"] = Tab;
                }
            }
            else if (pc["Calendar1_CurrentTab"] == null)
            {
                pc["Calendar1_CurrentTab"] = "MyCalendar";
            }

            using (IDataReader rdr = Mediachase.IBN.Business.CalendarView.GetListPeopleForCalendar())
            {
                if (!rdr.Read() && pc["Calendar1_CurrentTab"] == "SharedCalendars")
                {
                    pc["Calendar1_CurrentTab"] = "MyCalendar";
                }
            }

            string controlName = "CalendarViewMy.ascx";

            if (pc["Calendar1_CurrentTab"] == "MyCalendar")
            {
                ((Mediachase.UI.Web.Modules.PageTemplateNew) this.Parent.Parent.Parent.Parent).Title = LocRM.GetString("tMyCalendar");
            }
            else if (pc["Calendar1_CurrentTab"] == "SharedCalendars")
            {
                ((Mediachase.UI.Web.Modules.PageTemplateNew) this.Parent.Parent.Parent.Parent).Title = LocRM.GetString("tSharedCalendars");
            }

            System.Web.UI.UserControl control = (System.Web.UI.UserControl)LoadControl(controlName);
            phItems.Controls.Add(control);
        }
		protected override void OnInit(EventArgs e)
		{
			base.OnInit (e);
            System.Web.UI.Control u = new System.Web.UI.UserControl().LoadControl(SystemDirectories.Umbraco + "/controls/genericProperties/GenericProperty.ascx");
			u.ID = this.ID + "_control";
			((GenericProperty) u).Delete += new EventHandler(GenericPropertyWrapper_Delete);
			((GenericProperty) u).FullId = _fullId;
			this.Controls.Add(u);
			UpdateEditControl();
		}
Example #32
0
        private void BindPropertyPage()
        {
            tdHandlerSets.Controls.Clear();
            trHandlerSets.Visible = false;
            propertyPageControl = null;
            lblHandlerDesc.Text = "";

            if (Pop3Manager.Current.SelectedPop3Box.Handlers.Count > 0)
            {
                lblHandlerDesc.Text = Pop3Manager.Current.SelectedPop3Box.Handlers[0].Handler.Description;
                if (Pop3Manager.Current.SelectedPop3Box.Handlers[0].PropertyControlPath != string.Empty)
                {
                    try
                    {
                        propertyPageControl = (System.Web.UI.UserControl)Page.LoadControl(Pop3Manager.Current.SelectedPop3Box.Handlers[0].PropertyControlPath);
                        if (propertyPageControl is IPersistPop3MessageHandlerStorage && _CallPropertyPageLoad)
                        {
                            ((IPersistPop3MessageHandlerStorage)propertyPageControl).Load(Pop3Manager.Current.SelectedPop3Box);
                        }
                    }
                    catch (Exception ex)
                    {
                        //System.Diagnostics.Trace.WriteLine(ex);
                        Label lblErrLoadMessage = new Label();
                        lblErrLoadMessage.CssClass = "text";
                        lblErrLoadMessage.Style.Add("color", "red");
                        lblErrLoadMessage.Text = ex.ToString();
                        tdHandlerSets.Controls.Add(lblErrLoadMessage);
                        trHandlerSets.Visible = true;
                        return;
                    }
                    tdHandlerSets.Controls.Add(propertyPageControl);
                    trHandlerSets.Visible = true;
                }
            }
        }
 public EnzymeWebUserControlContext(System.Web.UI.UserControl instance)
 {
     _Instance = instance;
     _InstanceType = _Instance.GetType();
 }