コード例 #1
0
 public TokenReplace(Scope AccessLevel, string Language, PortalSettings PortalSettings, UserInfo User, int ModuleID)
 {
     this.CurrentAccessLevel = AccessLevel;
     if (AccessLevel != Scope.NoSettings)
     {
         if (PortalSettings == null)
         {
             if (HttpContext.Current != null)
             {
                 this.PortalSettings = PortalController.GetCurrentPortalSettings();
             }
         }
         else
         {
             this.PortalSettings = PortalSettings;
         }
         if (User == null)
         {
             if (HttpContext.Current != null)
             {
                 this.User = (UserInfo)HttpContext.Current.Items["UserInfo"];
             }
             else
             {
                 this.User = new UserInfo();
             }
             this.AccessingUser = this.User;
         }
         else
         {
             this.User = User;
             if (HttpContext.Current != null)
             {
                 this.AccessingUser = (UserInfo)HttpContext.Current.Items["UserInfo"];
             }
             else
             {
                 this.AccessingUser = new UserInfo();
             }
         }
         if (string.IsNullOrEmpty(Language))
         {
             this.Language = new Localization.Localization().CurrentCulture;
         }
         else
         {
             this.Language = Language;
         }
         if (ModuleID != Null.NullInteger)
         {
             this.ModuleId = ModuleID;
         }
     }
     PropertySource["date"]     = new DateTimePropertyAccess();
     PropertySource["datetime"] = new DateTimePropertyAccess();
     PropertySource["ticks"]    = new TicksPropertyAccess();
     PropertySource["culture"]  = new CulturePropertyAccess();
 }
コード例 #2
0
 public TokenReplace(Scope AccessLevel, string Language, PortalSettings PortalSettings, UserInfo User, int ModuleID)
 {
     this.CurrentAccessLevel = AccessLevel;
     if (AccessLevel != Scope.NoSettings)
     {
         if (PortalSettings == null)
         {
             if (HttpContext.Current != null)
                 this.PortalSettings = PortalController.GetCurrentPortalSettings();
         }
         else
         {
             this.PortalSettings = PortalSettings;
         }
         if (User == null)
         {
             if (HttpContext.Current != null)
             {
                 this.User = (UserInfo)HttpContext.Current.Items["UserInfo"];
             }
             else
             {
                 this.User = new UserInfo();
             }
             this.AccessingUser = this.User;
         }
         else
         {
             this.User = User;
             if (HttpContext.Current != null)
             {
                 this.AccessingUser = (UserInfo)HttpContext.Current.Items["UserInfo"];
             }
             else
             {
                 this.AccessingUser = new UserInfo();
             }
         }
         if (string.IsNullOrEmpty(Language))
         {
             this.Language = new Localization.Localization().CurrentCulture;
         }
         else
         {
             this.Language = Language;
         }
         if (ModuleID != Null.NullInteger)
         {
             this.ModuleId = ModuleID;
         }
     }
     PropertySource["date"] = new DateTimePropertyAccess();
     PropertySource["datetime"] = new DateTimePropertyAccess();
     PropertySource["ticks"] = new TicksPropertyAccess();
     PropertySource["culture"] = new CulturePropertyAccess();
 }