本文整理汇总了C#中SiteInfo类的典型用法代码示例。如果您正苦于以下问题:C# SiteInfo类的具体用法?C# SiteInfo怎么用?C# SiteInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SiteInfo类属于命名空间,在下文中一共展示了SiteInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetWildcardSettingsFolder
public static Item GetWildcardSettingsFolder(SiteInfo siteInfo)
{
if(Sitecore.Context.Database == null || siteInfo == null)
{
return null;
}
string xpath = $"/sitecore/wildcard/settings/*[@name = '{siteInfo.Name}']";
var node = Factory.GetConfigNode(xpath);
if (node == null)
{
node = Factory.GetConfigNode("/sitecore/wildcard/settings/*[@name = 'Default']");
}
if(node == null)
{
return null;
}
var path = XmlUtil.GetAttribute("path", node, true);
if(string.IsNullOrWhiteSpace(path))
{
return null;
}
if(!path.StartsWith("/sitecore/", System.StringComparison.OrdinalIgnoreCase))
{
path = string.Concat(siteInfo.RootPath, StringUtil.EnsurePrefix('/', path));
}
return Sitecore.Context.Database.GetItem(path);
}
开发者ID:cvandeluitgaarden,项目名称:Sitecore.SharedSource.Wildcard,代码行数:32,代码来源:WildcardProvider.cs
示例2: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
siteId = QueryHelper.GetInteger("siteid", 0);
si = SiteInfoProvider.GetSiteInfo(siteId);
EditedObject = si;
if (!RequestHelper.IsPostBack())
{
// Load input fields for the first time
txtMessage.Value = si.SiteOfflineMessage;
txtURL.Text = si.SiteOfflineRedirectURL;
radURL.Checked = !String.IsNullOrEmpty(txtURL.Text);
radMessage.Checked = !String.IsNullOrEmpty(txtMessage.Value);
if (!radURL.Checked && !radMessage.Checked)
{
radMessage.Checked = true;
}
}
txtMessage.MediaDialogConfig.HideContent = true;
ScriptHelper.RegisterClientScriptBlock(Page, typeof(string), "EnableDisableTextBox", ScriptHelper.GetScript(
"function EnableDisableBox(elementId, state) \n" +
"{ var elem = document.getElementById(elementId); \n" +
" if (elem) { \n" +
" if (state == 0) { elem.disabled = 'disabled'; elem.readonly = 'readonly'; } \n" +
" if (state == 1) { elem.disabled = ''; elem.readonly = ''; } \n" +
" } \n" +
"} \n"));
radMessage.Attributes.Add("onclick", "EnableDisableBox('" + txtURL.ClientID + "', 0); EnableDisableBox('" + txtMessage.ClientID + "', 1);");
radURL.Attributes.Add("onclick", "EnableDisableBox('" + txtURL.ClientID + "', 1); EnableDisableBox('" + txtMessage.ClientID + "', 0);");
}
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:35,代码来源:Site_Edit_OfflineMode.aspx.cs
示例3: ImportMyLogsWithCachesAsync
public async Task ImportMyLogsWithCachesAsync(Core.Storage.Database db, SiteInfo activeSite)
{
using (Utils.DataUpdater upd = new Utils.DataUpdater(db))
{
await Task.Run(new Action(() => ImportMyLogsWithCaches(db, activeSite)));
}
}
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:7,代码来源:Import.cs
示例4: GetUsersWaitingForApprovalCount
/// <summary>
/// Gets number of users waiting for approval.
/// </summary>
/// <param name="site">Tile's site</param>
/// <returns>Number of users waiting for approval</returns>
private static int GetUsersWaitingForApprovalCount(SiteInfo site)
{
return UserInfoProvider.GetUsers()
.Source(s => s.Join<UserSettingsInfo>("UserID", "UserSettingsUserID"))
.OnSite(site.SiteID)
.WhereEquals("UserWaitingForApproval", 1)
.Count;
}
开发者ID:dlnuckolls,项目名称:pfh-paypalintegration,代码行数:13,代码来源:UsersLiveTileModelProvider.cs
示例5: SetSiteInfoInternal
/// <summary>
/// Sets the specified site data.
/// </summary>
/// <param name="siteInfoObj">New site info data</param>
protected override void SetSiteInfoInternal(SiteInfo siteInfoObj)
{
base.SetSiteInfoInternal(siteInfoObj);
// Log the event that the site was updated
EventLogProvider ev = new EventLogProvider();
ev.LogEvent(EventLogProvider.EVENT_TYPE_INFORMATION, DateTime.Now, "MyCustomSiteInfoProvider", "SetSiteInfo", null, "The site was updated");
}
开发者ID:puentepr,项目名称:kentico-site-example,代码行数:12,代码来源:CustomSiteInfoProvider.cs
示例6: GetHostName
private static string GetHostName(SiteInfo site)
{
if (!string.IsNullOrEmpty(site.TargetHostName))
return site.TargetHostName;
if (Uri.CheckHostName(site.HostName) != UriHostNameType.Unknown)
return site.HostName;
throw new ConfigurationErrorsException($"Cannot determine hostname for site '{site}'");
}
开发者ID:alinulms,项目名称:Habitat,代码行数:8,代码来源:SiteDefinitionsProvider.cs
示例7: AuthorizationWindow
public AuthorizationWindow(SiteInfo siteInfo)
: this()
{
_siteInfo = siteInfo;
webBrowser.LoadCompleted += webBrowser_LoadCompleted;
webBrowser.NavigateToString("<html><body><h1>Loading authorization page, please wait...</h1></body></html>");
}
开发者ID:gahadzikwa,项目名称:GAPP,代码行数:8,代码来源:AuthorizationWindow.xaml.cs
示例8: CreateSiteDefinition
private SiteDefinition CreateSiteDefinition(SiteInfo siteInfo)
{
return new SiteDefinition
{
HostName = siteInfo.HostName,
Name = siteInfo.Name,
IsCurrent = IsCurrent(siteInfo.Name)
};
}
开发者ID:mikeedwards83,项目名称:Habitat,代码行数:9,代码来源:ConfigurationSiteDefinitionsProvider.cs
示例9: LogMessage
public static void LogMessage(string message, SiteInfo siteInfo)
{
StringBuilder msg = new StringBuilder(Environment.NewLine);
msg.Append("*** MESSAGE ***\r\n")
.Append("SITE:\t").Append(siteInfo.SiteCode).Append("\r\n")
.Append("DATE:\t").Append(DateTime.Now.ToString()).Append("\r\n")
.Append("CONTENT:\t").Append(message).Append("\r\n");
File.AppendAllText(LOG_FILE, msg.ToString(), Encoding.UTF8);
}
开发者ID:rivernli,项目名称:CommonJob,代码行数:10,代码来源:JOBTool.cs
示例10: LogError
public static void LogError(Exception ex, SiteInfo siteInfo)
{
StringBuilder err = new StringBuilder(Environment.NewLine);
err.Append("=== EXCEPTION ===\r\n")
.Append("SITE:\t").Append(siteInfo.SiteCode).Append("\r\n")
.Append("DATE:\t").Append(DateTime.Now.ToString()).Append("\r\n")
.Append("MESSAGE:").Append(ex.Message).Append("\r\n")
.Append("STACKTRACE:").Append("\r\n")
.Append(ex.StackTrace);
File.AppendAllText(LOG_FILE, err.ToString(), Encoding.UTF8);
}
开发者ID:rivernli,项目名称:CommonJob,代码行数:12,代码来源:JOBTool.cs
示例11: GetSiteRootItem
private Item GetSiteRootItem(SiteInfo site)
{
if (site == null)
throw new ArgumentNullException(nameof(site));
if (string.IsNullOrEmpty(site.Database))
return null;
var database = Database.GetDatabase(site.Database);
var item = database?.GetItem(site.RootPath);
if (item == null || !IsSite(item))
return null;
return item;
}
开发者ID:alinulms,项目名称:Habitat,代码行数:12,代码来源:SiteDefinitionsProvider.cs
示例12: GetDataSources_ShouldReturnSourceTemplateFromSiteDefinition
public void GetDataSources_ShouldReturnSourceTemplateFromSiteDefinition([Frozen]ISettingsProvider settingsProvider, [Greedy]ConfigurationDatasourceProvider provider, string settingName, Item contextItem, DbItem sourceDbItem, Db db)
{
provider.Database = db.Database;
db.Add(sourceDbItem);
var sourceTemplate = db.GetItem(sourceDbItem.ID);
var attributeName = $"{settingName}.{ConfigurationDatasourceProvider.DatasourceTemplatePostfix}";
var siteInfo = new SiteInfo(new StringDictionary { { attributeName, sourceTemplate.ID.ToString() } });
settingsProvider.GetCurrentSiteInfo(Arg.Any<Item>()).Returns(siteInfo);
var sources = provider.GetDatasourceTemplate(settingName, contextItem);
sources.Should().NotBeNull();
sources.ID.ShouldBeEquivalentTo(sourceTemplate.ID);
}
开发者ID:mikeedwards83,项目名称:Habitat,代码行数:12,代码来源:ConfigurationDatasourceProviderTests.cs
示例13: GetNumberOfPendingPages
/// <summary>
/// Gets number of total pages waiting for the approval.
/// </summary>
/// <param name="siteInfo">Site the pages belongs to</param>
/// <param name="userInfo">The user providing the approval</param>
/// <returns>Total number of waiting pages</returns>
private int GetNumberOfPendingPages(SiteInfo siteInfo, UserInfo userInfo)
{
int siteId = siteInfo.SiteID;
// Get correct pending steps which may current user manage
var steps = new IDQuery<WorkflowStepInfo>().Where(WorkflowStepInfoProvider.GetWorkflowPendingStepsWhereCondition(userInfo, siteId));
var docs = new IDQuery<TreeNode>()
.OnSite(siteId)
.WhereIn("DocumentWorkflowStepID", steps);
return docs.Count;
}
开发者ID:kbuck21991,项目名称:kentico-blank-project,代码行数:19,代码来源:PendingPagesLiveModelProvider.cs
示例14: GetCarPmData
/// <summary>
/// 获取carPm数据
/// </summary>
/// <param name="siteInfo"></param>
/// <param name="log"></param>
/// <param name="tag"></param>
/// <param name="xmlSql"></param>
private void GetCarPmData(SiteInfo siteInfo, StringBuilder log, object tag, XmlDocument xmlSql, Database db, Database dbMultekApps)
{
// 从配置文件中获取,以分号隔开
string customerStr = xmlSql.SelectSingleNode("/Root/CarPm/Customers").InnerText.Trim();
string querySql = xmlSql.SelectSingleNode("/Root/CarPm/Select").InnerText;
string insertSql = xmlSql.SelectSingleNode("/Root/CarPm/Insert").InnerText;
string countSql = xmlSql.SelectSingleNode("/Root/CarPm/QueryCount").InnerText;
string updateSql = xmlSql.SelectSingleNode("/Root/CarPm/Update").InnerText;
// 拆分用户字段
string[] customs = customerStr.Split(new char[] {';', ',', ';', ','});
foreach (string custom in customs)
{
if (!string.IsNullOrWhiteSpace(custom))
{
DataTable dtCarPm = dbMultekApps.CustomSql(string.Format(querySql, custom)).ToDataTable();
foreach (DataRow drCarPm in dtCarPm.Rows)
{// 插入每行数据, 如存在则更新,否则插入
int count = db.CustomSql(string.Format(countSql, drCarPm["rpm"].ToString())).ToScalar<int>();
if (count > 0)
{//存在,则更新
string updateSqlNew = string.Format(updateSql,
drCarPm["pdesc"].ToString().Replace("'", "''"),
drCarPm["compelet_date"].ToString(),
drCarPm["resolution"].ToString().Replace("'", "''"),
drCarPm["delay_date"].ToString(),
drCarPm["rpm"].ToString());
db.CustomSql(updateSqlNew).ExecuteNonQuery();
}
else
{//不存在,插入
string insertSqlNew = string.Format(insertSql,
drCarPm["rpm"].ToString(),
custom,
drCarPm["pdesc"].ToString().Replace("'", "''"),
drCarPm["occurr_date"].ToString(),
drCarPm["compelet_date"].ToString(),
drCarPm["resolution"].ToString().Replace("'", "''"),
drCarPm["delay_date"].ToString()
);
db.CustomSql(insertSqlNew).ExecuteNonQuery();
}
}
}
}
}
开发者ID:rivernli,项目名称:CommonJob,代码行数:58,代码来源:GetDataFromDb.cs
示例15: CreateNewSiteInfo
public void CreateNewSiteInfo()
{
var profileId = profileRepository.FindProfileId(profileReference);
siteInfoRepository.DeleteSiteInfo(profileId);
var siteInfo = new SiteInfo
{
Id = string.Empty,
ProfileId = profileId,
Theme = "blue",
Title = "Michael Quinn - .NET Developer Irvine, CA",
Description = "Michael Quinn - .NET Developer Irvine, CA"
};
siteInfoRepository.SaveSiteInfo(siteInfo);
var results = siteInfoRepository.GetSiteInfo(profileId);
Assert.AreEqual(profileId, results.ProfileId);
}
开发者ID:michaelquinn5280,项目名称:Portfolio,代码行数:16,代码来源:SiteInfoRepositoryTests.cs
示例16: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
// Get the site info
si = SiteInfoProvider.GetSiteInfo(QueryHelper.GetInteger("siteId", 0));
if (si != null)
{
bool multilingual = LicenseHelper.CheckFeature(URLHelper.GetDomainName(si.DomainName), FeatureEnum.Multilingual);
bool cultureOnSite = CultureInfoProvider.IsCultureOnSite(CultureHelper.GetDefaultCulture(si.SiteName), si.SiteName);
if (!multilingual && !cultureOnSite)
{
lnkAssignDefault.Text = GetString("sitecultures.assigntodefault");
lnkAssignDefault.Visible = true;
plcAll.Visible = false;
}
else
{
// Redirect only if cultures not exceeded => to be able to unassign
if (!CultureInfoProvider.LicenseVersionCheck(si.DomainName, FeatureEnum.Multilingual, VersionActionEnum.Edit))
{
LicenseHelper.CheckFeatureAndRedirect(URLHelper.GetDomainName(si.DomainName), FeatureEnum.Multilingual);
}
}
lblAvialable.Text = GetString("site_edit_cultures.culturetitle");
siteName = si.SiteName;
// Store default culture (it can't be removed)
defaultCulture = CultureHelper.GetDefaultCulture(siteName);
// Get the active cultures from DB
DataSet ds = CultureInfoProvider.GetCultures("CultureID IN (SELECT CultureID FROM CMS_SiteCulture WHERE SiteID = " + si.SiteID + ")", null, 0, "CultureCode");
if (!DataHelper.DataSourceIsEmpty(ds))
{
currentValues = TextHelper.Join(";", SystemDataHelper.GetStringValues(ds.Tables[0], "CultureCode"));
}
if (!RequestHelper.IsPostBack())
{
uniSelector.Value = currentValues;
}
}
uniSelector.ReturnColumnName = "CultureCode";
uniSelector.OnSelectionChanged += uniSelector_OnSelectionChanged;
}
开发者ID:hollycooper,项目名称:Sportscar-Standings,代码行数:46,代码来源:Site_Edit_Cultures.aspx.cs
示例17: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
configuredSite = SiteInfoProvider.GetSiteInfo(ConfiguredSiteID);
// Check permissions for CMS Desk -> Ecommerce
if (!CMSContext.CurrentUser.IsAuthorizedPerUIElement("CMS.Ecommerce", "Configuration.Settings.CheckoutProcess"))
{
RedirectToCMSDeskUIElementAccessDenied("CMS.Ecommerce", "Configuration.Settings.CheckoutProcess");
}
// Set up header
CurrentMaster.HeaderActions.Actions = GetHeaderActions();
CurrentMaster.HeaderActions.ActionPerformed += HeaderActions_ActionPerformed;
// Modify page content css class
Panel pnl = CurrentMaster.PanelBody.FindControl("pnlContent") as Panel;
if (pnl != null)
{
pnl.CssClass = "";
}
// Hide buttons - this page has custom header action
ucCheckoutProcess.ShowActions = false;
ucCheckoutProcess.OnModeChanged += new CMSModules_Ecommerce_FormControls_CheckoutProcess.ModeChangedHandler(ucCheckoutProcess_OnModeChanged);
// Register javascript to confirm generate default checkout process
string script = "function ConfirmGlobalProcess() {return confirm(" + ScriptHelper.GetString(GetString("CheckoutProcess.ConfirmGlobalProcess")) + ");}";
ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ConfirmGlobalProcess", ScriptHelper.GetScript(script));
ucCheckoutProcess.OnCheckoutProcessDefinitionUpdate += new OnCheckoutProcessDefinitionUpdateEventHandler(ucCheckoutProcess_OnCheckoutProcessDefinitionUpdate);
// Load data
if (!RequestHelper.IsPostBack())
{
if (configuredSite != null)
{
ucCheckoutProcess.Value = ECommerceSettings.CheckoutProcess(configuredSite.SiteName);
}
else
{
ucCheckoutProcess.Value = ECommerceSettings.CheckoutProcess(null);
}
ucCheckoutProcess.EnableDefaultCheckoutProcessTypes = true;
}
}
开发者ID:v-jli,项目名称:jean0407large,代码行数:46,代码来源:StoreSettings_CheckoutProcess.aspx.cs
示例18: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
configuredSite = SiteInfoProvider.GetSiteInfo(ConfiguredSiteID);
// Check UI element
var elementName = IsMultiStoreConfiguration ? "Tools.Ecommerce.ChackoutSettings" : "Configuration.Settings.CheckoutProcess";
CheckUIElementAccessHierarchical(ModuleName.ECOMMERCE, elementName);
// Set up header
InitHeaderActions();
// Modify page content css class
Panel pnl = CurrentMaster.PanelBody.FindControl("pnlContent") as Panel;
if (pnl != null)
{
pnl.CssClass = "";
}
ucCheckoutProcess.OnModeChanged += ucCheckoutProcess_OnModeChanged;
// Register javascript to confirm generate default checkout process
string script = "function ConfirmGlobalProcess() {return confirm(" + ScriptHelper.GetString(GetString("CheckoutProcess.ConfirmGlobalProcess")) + ");}";
ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ConfirmGlobalProcess", ScriptHelper.GetScript(script));
ucCheckoutProcess.OnCheckoutProcessDefinitionUpdate += ucCheckoutProcess_OnCheckoutProcessDefinitionUpdate;
// Load data
if (!RequestHelper.IsPostBack())
{
if (configuredSite != null)
{
ucCheckoutProcess.Value = ECommerceSettings.CheckoutProcess(configuredSite.SiteName);
}
else
{
ucCheckoutProcess.Value = ECommerceSettings.CheckoutProcess(null);
}
ucCheckoutProcess.EnableDefaultCheckoutProcessTypes = true;
}
}
开发者ID:arvind-web-developer,项目名称:csharp-projects-Jemena-Kentico-CMS,代码行数:41,代码来源:StoreSettings_CheckoutProcess.aspx.cs
示例19: Execute
/// <summary>
/// 执行job
/// </summary>
/// <param name="siteInfo"></param>
/// <param name="log"></param>
/// <param name="tag"></param>
protected override void Execute(SiteInfo siteInfo, StringBuilder log, object tag)
{
// 读取xml中的sql语句执行
XmlDocument xmlSql = new XmlDocument();
xmlSql.Load(AppDomain.CurrentDomain.BaseDirectory + "SqlCommandText.xml");
Database db = new Database(DatabaseType.SqlServer, siteInfo.ConnectionConfig);
//创建multek_801 Multek_Apps数据库的连接
ConnectionStringSettings sqlServerConnectionApps = ConfigurationManager.ConnectionStrings["db_mcn801multekapp"];
Database dbMultekApps = new Database(DatabaseType.SqlServer, sqlServerConnectionApps.ConnectionString);
//创建multek_801 Multek_Apps数据库的连接
ConnectionStringSettings sqlServerConnectionBI = ConfigurationManager.ConnectionStrings["db_mcn801multekbi"];
Database dbMultekBI = new Database(DatabaseType.SqlServer, sqlServerConnectionBI.ConnectionString);
//获取carPm数据
GetCarPmData(siteInfo, log, tag, xmlSql, db, dbMultekApps);
//获取ForeCast, period_amount, bklog_amount数据
GetPeriodDataByCustom(siteInfo, log, tag, xmlSql, db, dbMultekBI);
}
开发者ID:rivernli,项目名称:CommonJob,代码行数:28,代码来源:GetDataFromDb.cs
示例20: GetSites
private static ArrayList GetSites()
{
ArrayList sites = f_sites;
if (sites == null)
{
sites = new ArrayList();
XmlNodeList configSites = GetSitesNodes("sites/site");
List<string> hostNames = new List<string>();
if (configSites != null)
{
foreach (XmlNode node in configSites)
{
SiteInfo info = new SiteInfo(node);
if (info.IsActive)
{
sites.Add(info);
}
}
}
f_sites = sites;
}
return sites;
}
开发者ID:ivansharamok,项目名称:SiteMapper,代码行数:23,代码来源:Sites.cs
注:本文中的SiteInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论