コード例 #1
0
        public string cnt_Container7_setInlineAttributes(object sender, System.EventArgs e)
        {
            ObjectKey oldCurrentESpaceKey = heContext.CurrentESpaceKey;

            try {
                heContext.CurrentESpaceKey    = ssContactManager.Global.eSpaceKey;
                ((WebControl)sender).CssClass = Functions.ActionMenu_GetStyle(heContext, (inParamActiveMenuItemId == ENMenuItemEntity.GetRecordByKey(ObjectKey.Parse("bQMfrwAt5UaQWFeNE2K7bg")).ssId), "Menu_TopMenu Menu_TopMenuActive", "Menu_TopMenu");
                if (!cnt_Container7_isVisible())
                {
                    string stylevalue = ((IAttributeAccessor)sender).GetAttribute("style");
                    {
                        string newstyledef;
                        string oldstyledef;
                        newstyledef = stylevalue + ((stylevalue != null && !stylevalue.TrimEnd().EndsWith(";")) ? ";": "") + "display:none";
                        oldstyledef = ((IAttributeAccessor)sender).GetAttribute("style");
                        if (oldstyledef != null)
                        {
                            if (!oldstyledef.TrimEnd().EndsWith(";"))
                            {
                                newstyledef = ";" + newstyledef;
                            }
                            if (!oldstyledef.EndsWith(newstyledef))
                            {
                                ((IAttributeAccessor)sender).SetAttribute("style", oldstyledef + newstyledef.ToString());
                            }
                            else
                            {
                                ((IAttributeAccessor)sender).SetAttribute("style", oldstyledef.ToString());
                            }
                        }
                        else
                        {
                            ((IAttributeAccessor)sender).SetAttribute("style", newstyledef.ToString());
                        }
                    }
                }
                else
                {
                    string stylevalue = ((IAttributeAccessor)sender).GetAttribute("style");
                    if (stylevalue != null)
                    {
                        ((IAttributeAccessor)sender).SetAttribute("style", stylevalue.Replace("display:none;", "").Replace("display:none", "").ToString());
                    }
                }
                return("");
            } finally {
                heContext.CurrentESpaceKey = oldCurrentESpaceKey;
            }
        }