本文整理汇总了C#中DotNetNuke.Entities.Portals.PortalAliasController.GetPortalAliases方法的典型用法代码示例。如果您正苦于以下问题:C# PortalAliasController.GetPortalAliases方法的具体用法?C# PortalAliasController.GetPortalAliases怎么用?C# PortalAliasController.GetPortalAliases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Portals.PortalAliasController
的用法示例。
在下文中一共展示了PortalAliasController.GetPortalAliases方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
private void Page_Load(object sender, System.EventArgs e)
{
RotatorSettings rotatorSettings = new RotatorSettings();
rotatorSettings.Hosts = new System.Collections.Generic.List<System.Web.UI.WebControls.ListItem>();
PortalAliasController paCtrl = new PortalAliasController();
foreach (DictionaryEntry de in paCtrl.GetPortalAliases()) {
PortalAliasInfo paInfo = (PortalAliasInfo)de.Value;
rotatorSettings.Hosts.Add(new ListItem(paInfo.HTTPAlias, paInfo.HTTPAlias));
}
Control ctrlAct = LoadControl(TemplateSourceDirectory.TrimEnd('/') + "/RegCore/QuickStatusAndLink.ascx");
(ctrlAct as IRegCoreComponent).InitRegCore(IsAdmin, RotatorSettings.RegCoreServer, RotatorSettings.ProductName, RotatorSettings.ProductCode, RotatorSettings.ProductKey, RotatorSettings.Version, TemplateSourceDirectory.TrimEnd('/') + "/RegCore/", typeof(DynamicRotatorController));
this.pnlAdmin.Controls.Add(ctrlAct);
if (!rotatorSettings.IsActivated() || rotatorSettings.IsTrialExpired()) {
DynamicRotator.Visible = false;
}
}
示例2: GetPortalAliasLookup
public static PortalAliasCollection GetPortalAliasLookup()
{
PortalAliasCollection objPortalAliasCollection = (PortalAliasCollection)DataCache.GetCache( "GetPortalByAlias" );
try
{
if( objPortalAliasCollection == null )
{
PortalAliasController objPortalAliasController = new PortalAliasController();
objPortalAliasCollection = objPortalAliasController.GetPortalAliases();
DataCache.SetCache( "GetPortalByAlias", objPortalAliasCollection );
}
}
catch( Exception exc )
{
// this is the first data access in Begin_Request and will catch any general connection issues
HttpContext objHttpContext = HttpContext.Current;
StreamReader objStreamReader;
objStreamReader = File.OpenText( objHttpContext.Server.MapPath( "~/500.htm" ) );
string strHTML = objStreamReader.ReadToEnd();
objStreamReader.Close();
strHTML = strHTML.Replace( "[MESSAGE]", "ERROR: Could not connect to database.<br><br>" + exc.Message );
objHttpContext.Response.Write( strHTML );
objHttpContext.Response.End();
}
return objPortalAliasCollection;
}
示例3: FillAll
private void FillAll()
{
ddHosts.Items.Clear();
PortalAliasController paCtrl = new PortalAliasController();
foreach (DictionaryEntry de in paCtrl.GetPortalAliases()) {
PortalAliasInfo paInfo = (PortalAliasInfo)de.Value;
string httpAlias = paInfo.HTTPAlias;
bool isIP = (Regex.Match(httpAlias, ".*\\d+\\.\\d+\\.\\d+\\.\\d+.*").Length > 0);
// remove port, if exists
if (httpAlias.LastIndexOf(":") != -1) httpAlias = httpAlias.Substring(0, httpAlias.IndexOf(":"));
// remove path
if (httpAlias.LastIndexOf("/") != -1) httpAlias = httpAlias.Substring(0, httpAlias.IndexOf("/"));
// remove www.
if (!isIP && httpAlias.IndexOf("www.") != -1) httpAlias = httpAlias.Substring(httpAlias.IndexOf("www.") + 4);
if (!isIP && httpAlias.IndexOf("dev.") != -1) httpAlias = httpAlias.Substring(httpAlias.IndexOf("dev.") + 4);
if (!isIP && httpAlias.IndexOf("staging.") != -1) httpAlias = httpAlias.Substring(httpAlias.IndexOf("staging.") + 8);
if (httpAlias.IndexOf("127.0.0.1") == 0) {
continue;
}
if (ddHosts.Items.FindByText(httpAlias) != null) {
continue; // item already exists
}
ddHosts.Items.Add(new ListItem(httpAlias, httpAlias));
}
}
示例4: FillDomains
private void FillDomains()
{
ddHosts.Items.Clear();
PortalAliasController paCtrl = new PortalAliasController();
foreach (DictionaryEntry de in paCtrl.GetPortalAliases()) {
PortalAliasInfo paInfo = (PortalAliasInfo)de.Value;
FillIp(paInfo.HTTPAlias);
}
}
示例5: getPortalId
/// <summary>
/// returns the portalId or -1 if something goes wrong
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public static int getPortalId(HttpContext context)
{
var retVal = -1;
var url = getUriWithoutProtocol(context.Request.Url);
var controller = new PortalAliasController();
var aliasCollection = controller.GetPortalAliases();
foreach (string key in aliasCollection.Keys)
{
var info = aliasCollection[key];
if (url.StartsWith(info.HTTPAlias))
retVal = info.PortalID;
}
return retVal;
}
示例6: setPortalIdAndPageName
/// <summary>
/// returns the portalId or -1 if something goes wrong
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public void setPortalIdAndPageName(HttpContext context)
{
portalId = -1;
asmxName = null;
var url = getUriWithoutProtocol(context.Request.Url);
var controller = new PortalAliasController();
var aliasCollection = controller.GetPortalAliases();
foreach (string key in aliasCollection.Keys)
{
var info = aliasCollection[key];
if (url.StartsWith(info.HTTPAlias))
{
portalId = info.PortalID;
asmxName = url.Substring(info.HTTPAlias.Length + 1);
}
}
}
示例7: IsDuplicateWithPortalAlias
/// <summary>
/// check whether have conflict between tab path and portal alias.
/// </summary>
/// <param name="portalId">portal id.</param>
/// <param name="tabPath">tab path.</param>
/// <returns></returns>
public static bool IsDuplicateWithPortalAlias(int portalId, string tabPath)
{
var aliasController = new PortalAliasController();
var aliasLookup = aliasController.GetPortalAliases().Values.Cast<PortalAliasInfo>();
foreach (PortalAliasInfo alias in aliasController.GetPortalAliasArrayByPortalID(portalId))
{
var checkAlias = string.Format("{0}{1}", alias.HTTPAlias, tabPath.Replace("//", "/"));
if(aliasLookup.Any(a => a.HTTPAlias.Equals(checkAlias, StringComparison.InvariantCultureIgnoreCase)))
{
return true;
}
}
return false;
}