欢迎来到飞鸟慕鱼博客,开始您的技术之旅!
当前位置: 首页知识笔记正文

项目重装.

终极管理员 知识笔记 131阅读

I终于开始了这个项目,我感到非常兴奋。虽然我有几年的工作经验。NET编程,我在ASP.Net几乎没有经验,所以我现在就请教专家。由于经验不多,我想解读几个ASP.Net(ASP.Net入门套件Dotnetnuke)的大型例子,希望能和大家分享一下我的解剖经验。1.ASP.Net门户初学者工具包根据访问顺序开始逐文件分析(在此之后分析数据库和存储过程)1。Default.aspx这是首页的引导页,根据不同的访问设备,引导到不同的页面。2.DesktopDefault.aspx PC访问您转到的页面。引用的类:(1)门户设置: publiclassportalsettings { PublicIntPortalid;publicStringPortalNamepublicboolAlwaysShowEditButtonpublicArrayListDesktopTabs

nbsp;= new ArrayList();
        
public ArrayList    MobileTabs = new ArrayList();
        
public TabSettings  ActiveTab = new TabSettings();

        
//*********************************************************************
        
//
        
// PortalSettings Constructor
        
//
        
// The PortalSettings Constructor encapsulates all of the logic
        
// necessary to obtain configuration settings necessary to render
        
// a Portal Tab view for a given request.
        
//
        
// These Portal Settings are stored within PortalCFG.xml, and are
        
// fetched below by calling config.GetSiteSettings().
        
// The method config.GetSiteSettings() fills the SiteConfiguration
        
// class, derived from a DataSet, which PortalSettings accesses.
        
//       
        
//*********************************************************************

        
public PortalSettings(int tabIndex, int tabId) 
        
{
            
// Get the configuration data
            SiteConfiguration siteSettings = Configuration.GetSiteSettings();

            
// Read the Desktop Tab Information, and sort by Tab Order
            foreach(SiteConfiguration.TabRow tRow in siteSettings.Tab.Select("""TabOrder"))
            
{
                TabStripDetails tabDetails 
= new TabStripDetails();

                tabDetails.TabId 
= tRow.TabId;
                tabDetails.TabName 
= tRow.TabName;
                tabDetails.TabOrder 
= tRow.TabOrder;
                tabDetails.AuthorizedRoles 
= tRow.AccessRoles;

                
this.DesktopTabs.Add(tabDetails);
            }


            
// If the PortalSettings.ActiveTab property is set to 0, change it to  
            
// the TabID of the first tab in the DesktopTabs collection
            if(this.ActiveTab.TabId == 0)
                
this.ActiveTab.TabId = ((TabStripDetails)this.DesktopTabs[0]).TabId;


            
// Read the Mobile Tab Information, and sort by Tab Order
            foreach(SiteConfiguration.TabRow mRow in siteSettings.Tab.Select("ShowMobile='true'""TabOrder"))
            
{
                TabStripDetails tabDetails 
= new TabStripDetails();

                tabDetails.TabId 
= mRow.TabId;
                tabDetails.TabName 
= mRow.MobileTabName;
                tabDetails.AuthorizedRoles 
= mRow.AccessRoles;
                
                
this.MobileTabs.Add(tabDetails);
            }


            
// Read the Module Information for the current (Active) tab
            SiteConfiguration.TabRow activeTab = siteSettings.Tab.FindByTabId(tabId);

            
// Get Modules for this Tab based on the Data Relation
            foreach(SiteConfiguration.ModuleRow moduleRow in activeTab.GetModuleRows())
            
{
                ModuleSettings moduleSettings 
= new ModuleSettings();

                moduleSettings.ModuleTitle 
= moduleRow.ModuleTitle;
                moduleSettings.ModuleId 
= moduleRow.ModuleId;
                moduleSettings.ModuleDefId 
= moduleRow.ModuleDefId;
                moduleSettings.ModuleOrder 
= moduleRow.ModuleOrder;
                moduleSettings.TabId 
= tabId;
                moduleSettings.PaneName 
= moduleRow.PaneName;
                moduleSettings.AuthorizedEditRoles 
= moduleRow.EditRoles;
                moduleSettings.CacheTime 
= moduleRow.CacheTimeout;
                moduleSettings.ShowMobile 
= moduleRow.ShowMobile;

                
// ModuleDefinition data
                SiteConfiguration.ModuleDefinitionRow modDefRow = siteSettings.ModuleDefinition.FindByModuleDefId(moduleSettings.ModuleDefId);

                moduleSettings.DesktopSrc 
= modDefRow.DesktopSourceFile;
                moduleSettings.MobileSrc 
= modDefRow.MobileSourceFile;
                
                
this.ActiveTab.Modules.Add(moduleSettings);
            }


            
// Sort the modules in order of ModuleOrder
            this.ActiveTab.Modules.Sort();

            
// Get the first row in the Global table
            SiteConfiguration.GlobalRow globalSettings = (SiteConfiguration.GlobalRow) siteSettings.Global.Rows[0];

            
// Read Portal global settings 
            this.PortalId = globalSettings.PortalId;
            
this.PortalName = globalSettings.PortalName;
            
this.AlwaysShowEditButton = globalSettings.AlwaysShowEditButton;
            
this.ActiveTab.TabIndex = tabIndex;
            
this.ActiveTab.TabId = tabId;
            
this.ActiveTab.TabOrder = activeTab.TabOrder;
            
this.ActiveTab.MobileTabName = activeTab.MobileTabName;
            
this.ActiveTab.AuthorizedRoles = activeTab.AccessRoles;
            
this.ActiveTab.TabName = activeTab.TabName;
            
this.ActiveTab.ShowMobile = activeTab.ShowMobile;
        }

    }


    其中引用了:TabSettings,  TabStripDetails, SiteConfiguration
    前两个类的代码:
   
public class TabStripDetails 
    
{

        
public int          TabId;
        
public String       TabName;
        
public int          TabOrder;
        
public String       AuthorizedRoles;
    }

public class TabSettings 
    
{
                           
        
public int          TabIndex;
        
public int          TabId;
        
public String       TabName;
        
public int          TabOrder;
        
public String       MobileTabName;
        
public String       AuthorizedRoles;
        
public bool         ShowMobile;
        
public ArrayList    Modules = new ArrayList();
    }

第三个太长了,就不在这里写了。
具体的代码分析留在下次了(吃饭要紧)。

标签:
声明:无特别说明,转载请标明本文来源!