Пример #1
0
        //*********************************************************************
        //
        // TabView_OnActivate Event Handler
        //
        // The TabView_OnActivate event handler executes when the user switches
        // tabs in the tab view. It calls the PopulateTabView utility
        // method to dynamically populate the newly activated view.
        //
        //*********************************************************************

        private void TabView_OnTabActivate(Object sender, EventArgs e)
        {
            // Obtain PortalSettings from Current Context
            PortalSettings portalSettings = (PortalSettings)HttpContext.Current.Items["PortalSettings"];

            int tabIndex = TabView.ActivePaneIndex;
            int tabID    = ((TabStripDetails)portalSettings.MobileTabs[tabIndex]).TabId;

            // Store tabindex in a hidden variable to preserve accross round trips
            if (tabIndex != 0)
            {
                HiddenVariables["ti"] = String.Concat(tabIndex.ToString(), ",", tabID.ToString());
            }
            else
            {
                HiddenVariables.Remove("ti");
            }

            // Check to see if portal settings need reloading
            LoadPortalSettings(tabIndex, tabID);

            // Populate the newly active tab.
            PopulateTabView(tabIndex);

            // Set the view to summary mode, where a summary of all the modules are shown.
            ((MobilePortalTab)TabView.ActivePane).SummaryView = true;
        }
Пример #2
0
        public void LoadVariableTypes(Assembly assembly)
        {
            var varRegisters = assembly.GetCustomAttributes(typeof(VariableRegisterAttribute), false);

            foreach (VariableRegisterAttribute attr in varRegisters)
            {
                if (!VariableTypes.ContainsKey(attr.VariableType) || attr.EditorType != null)
                {
                    VariableTypes[attr.VariableType] = attr.EditorType;
                }
                if (attr.Hidden)
                {
                    HiddenVariables.Add(attr.VariableType);
                }
            }
        }