本文整理汇总了C#中Site类的典型用法代码示例。如果您正苦于以下问题:C# Site类的具体用法?C# Site怎么用?C# Site使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Site类属于命名空间,在下文中一共展示了Site类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DynamicRenderDocument
public DynamicRenderDocument(DocumentFile document, LayoutFile layout, Site site)
: base(document.SourceRelativePath)
{
_document = document;
_layout = layout;
_site = site;
}
开发者ID:fearthecowboy,项目名称:tinysite,代码行数:7,代码来源:DynamicRenderDocument.cs
示例2: CheckPages
public IEnumerable<Site.SpellcheckResult> CheckPages(Guid siteId, IEnumerable<Guid> pageIds, Site.SpellcheckConfigurations configurations)
{
var results = new List<Site.SpellcheckResult>();
foreach (var pageId in pageIds)
{
var page = _blobs.Get<PageProfile>(new BlobReference(siteId, pageId));
var config = configurations.GetFor(page.Url);
if (config == null) continue;
var spellchecker = _spellcheckerFactory.CreateFor(config.PrimaryLanguageKey, config.SecondaryLanguageKey);
var result = spellchecker.Check(page.Text);
if (result.HasData)
{
results.Add(new Site.SpellcheckResult
{
PageId = pageId,
ConfirmedMisspellings = result.Misspellings,
PotentialMisspellings = result.PotentialMisspellings,
SiteId = siteId
});
}
}
return results;
}
开发者ID:aclemmensen,项目名称:TinyCQRS,代码行数:28,代码来源:SpellcheckService.cs
示例3: DynamicPaginator
public DynamicPaginator(DocumentFile activeDocument, Paginator Paginator, Site site)
: base(null)
{
this.ActiveDocument = activeDocument;
this.Paginator = Paginator;
this.Site = site;
}
开发者ID:fearthecowboy,项目名称:tinysite,代码行数:7,代码来源:DynamicPaginator.cs
示例4: AuthenticateUser
/// <summary>
/// Try to authenticate the user with username & password
/// </summary>
/// <param name="site"></param>
/// <param name="email"></param>
/// <param name="password"></param>
/// <param name="ipAddress"></param>
/// <param name="createPersistentCookie"></param>
/// <returns></returns>
public User AuthenticateUser(Site site, string email, string password, string ipAddress, bool createPersistentCookie)
{
string hashedPassword = password.EncryptToSHA2();
if (site == null)
{
const string msg = "FormsAuthenticationService.AuthenticateUser invoked with Site = NULL";
log.Error(msg);
throw new ApplicationException(msg);
}
try
{
User user = userService.GetUserByEmailAndPassword(site, email, hashedPassword);
if (user != null)
{
LogIn(user, ipAddress, createPersistentCookie);
}
else
{
log.WarnFormat("Invalid username-password combination: {0}:{1} on SiteId = {2}", email, password, site.SiteId.ToString());
}
return user;
}
catch (Exception ex)
{
log.ErrorFormat("An error occured while logging in user {0} on SiteId = {1}", email, site.SiteId.ToString());
throw new Exception(String.Format("Unable to log in user '{0}': " + ex.Message, email), ex);
}
}
开发者ID:aozora,项目名称:arashi,代码行数:40,代码来源:FormsAuthenticationService.cs
示例5: SetFeaturesForSite
public void SetFeaturesForSite(Site site)
{
if (site.Features.Count > 0)
{
log.WarnFormat("Can't add Features to siteid {0} because it already has {1} features", site.SiteId.ToString(), site.Features.Count.ToString());
throw new ApplicationException("Site already has features!");
}
IList<Feature> features = FindAll();
foreach (Feature feature in features)
{
SiteFeature sf = new SiteFeature()
{
Site = site,
Feature = feature,
Enabled = false,
StartDate = DateTime.Now.ToUniversalTime(),
EndDate = null
};
site.Features.Add(sf);
}
siteService.SaveSite(site);
}
开发者ID:aozora,项目名称:arashi,代码行数:25,代码来源:FeatureService.cs
示例6: getPoolSources
/// <summary>
/// Get a ConnectionsPoolsSource given a SiteTable using the factory's default pool source
/// </summary>
/// <param name="sources">SiteTable</param>
/// <returns>ConnectionPoolsSource</returns>
public override object getPoolSources(object sources)
{
if (!(sources is SiteTable))
{
throw new ArgumentException("Invalid source. Must supply a SiteTable");
}
SiteTable siteTable = (SiteTable)sources;
Site[] sites = new Site[siteTable.Sites.Count];
for (int i = 0; i < siteTable.Sites.Count; i++)
{
sites[i] = (Site)siteTable.Sites.GetByIndex(i);
}
ConnectionPoolsSource result = new ConnectionPoolsSource();
result.CxnSources = new Dictionary<string, ConnectionPoolSource>();
foreach (Site site in sites)
{
if (site.Sources == null || site.Sources.Length == 0)
{
continue;
}
for (int i = 0; i < site.Sources.Length; i++)
{
if (String.Equals(site.Sources[i].Protocol, "VISTA", StringComparison.CurrentCultureIgnoreCase)
|| String.Equals(site.Sources[i].Protocol, "PVISTA", StringComparison.CurrentCultureIgnoreCase))
{
result.CxnSources.Add(site.Id, (ConnectionPoolSource)getPoolSource(site.Sources[i]));
break;
}
}
}
return result;
}
开发者ID:kunalkot,项目名称:mdo,代码行数:37,代码来源:ConnectionPoolSourceFactory.cs
示例7: SiteWithConfig
public SiteWithConfig()
{
Site = new Site();
SiteConfig = new SiteConfig();
AppSettings = new Hashtable();
DiagnosticsSettings = new DiagnosticsSettings();
}
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:7,代码来源:SiteConfig.cs
示例8: DynamicDocumentFile
public DynamicDocumentFile(DocumentFile activeDocument, DocumentFile document, Site site)
: base(document)
{
this.ActiveDocument = activeDocument;
this.Document = document;
this.Site = site;
}
开发者ID:robmen,项目名称:tinysite,代码行数:7,代码来源:DynamicDocumentFile.cs
示例9: Generate
public string Generate(Site site)
{
StringBuilder sb = new StringBuilder();
DateTime pubDate = (DateTime)site.Content.Select(x => x.LastUpdate).Max();
sb.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
sb.AppendLine("<rss version=\"2.0\">");
sb.AppendLine("\t<channel>");
sb.AppendLine("\t<title>The Blog of Zachary Snow</title>");
sb.AppendLine("\t<description>The Blog of Zachary Snow</description>");
sb.AppendLine("\t<link>http://www.zacharysnow.net/</link>");
sb.AppendLine("\t<lastBuildDate>" + DateTime.Now.ToString("r") + "</lastBuildDate>");
sb.AppendLine("\t<pubDate>" + pubDate.ToString("r") + "</pubDate>");
sb.AppendLine("\t<ttl>1800</ttl>");
foreach (var post in site.Posts.Take(20))
{
sb.AppendLine("\t<item>");
sb.AppendLine("\t\t<title><![CDATA[" + post.Title + "]]></title>");
sb.AppendLine("\t\t<description><![CDATA[" + post.Excerpt + "]]></description>");
sb.AppendLine("\t\t<link>http://www.zacharysnow.net/" + post.Permalink + "</link>");
sb.AppendLine("\t\t<guid>http://www.zacharysnow.net/" + post.Permalink + "</guid>");
sb.AppendLine("\t\t<pubDate>" + post.Date.ToString("r") + "</pubDate>");
sb.AppendLine("\t</item>");
}
sb.AppendLine("\t</channel>");
sb.AppendLine("</rss>");
sb.AppendLine();
return sb.ToString();
}
开发者ID:smack0007,项目名称:zacharysnow.net,代码行数:33,代码来源:RssFeed.cs
示例10: AddUserVisitorGroup
/// <summary>
///
/// </summary>
/// <param name="ctx"></param>
/// <param name="site"></param>
/// <param name="name"></param>
public void AddUserVisitorGroup(ClientContext ctx, Site site, string name)
{
if(string.IsNullOrWhiteSpace(name))
{
//TODO LOG
}
}
开发者ID:Calisto1980,项目名称:PnP,代码行数:13,代码来源:SiteService.cs
示例11: DeploySearchConfiguration
private void DeploySearchConfiguration(object modelHost, Site site, SearchConfigurationDefinition definition)
{
var context = site.Context;
var conf = new SearchConfigurationPortability(context);
var owner = new SearchObjectOwner(context, SearchObjectLevel.SPSite);
InvokeOnModelEvent(this, new ModelEventArgs
{
CurrentModelNode = null,
Model = null,
EventType = ModelEventType.OnProvisioning,
Object = conf,
ObjectType = typeof(SearchConfigurationPortability),
ObjectDefinition = definition,
ModelHost = modelHost
});
conf.ImportSearchConfiguration(owner, definition.SearchConfiguration);
InvokeOnModelEvent(this, new ModelEventArgs
{
CurrentModelNode = null,
Model = null,
EventType = ModelEventType.OnProvisioned,
Object = conf,
ObjectType = typeof(SearchConfigurationPortability),
ObjectDefinition = definition,
ModelHost = modelHost
});
context.ExecuteQueryWithTrace();
}
开发者ID:Uolifry,项目名称:spmeta2,代码行数:33,代码来源:SearchConfigurationModelHandler.cs
示例12: CloneAndSendLocal
void CloneAndSendLocal(TransportMessage messageToDispatch, Site destinationSite)
{
//todo - do we need to clone? check with Jonathan O
messageToDispatch.Headers[Headers.DestinationSites] = destinationSite.Key;
MessageSender.Send(messageToDispatch, InputAddress);
}
开发者ID:kevinhillinger,项目名称:NServiceBus,代码行数:7,代码来源:GatewaySender.cs
示例13: Generate
private string Generate(Site site)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>");
sb.AppendLine("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">");
foreach (var post in site.Posts)
{
sb.AppendLine("\t<url>");
sb.AppendLine("\t\t<loc>http://zacharysnow.net/" + post.Permalink + "</loc>");
sb.AppendLine("\t</url>");
}
foreach (var page in site.Pages)
{
sb.AppendLine("\t<url>");
sb.AppendLine("\t\t<loc>http://zacharysnow.net/" + page.Permalink + "</loc>");
sb.AppendLine("\t</url>");
}
foreach (var page in site.GeneratorPages.Where(x => x.Data.IsRedirect != true))
{
sb.AppendLine("\t<url>");
sb.AppendLine("\t\t<loc>http://zacharysnow.net/" + page.Permalink + "</loc>");
sb.AppendLine("\t</url>");
}
sb.AppendLine("</urlset>");
sb.AppendLine();
return sb.ToString();
}
开发者ID:smack0007,项目名称:zacharysnow.net,代码行数:33,代码来源:Sitemap.cs
示例14: Test_AddSubSite_ChildSites
public void Test_AddSubSite_ChildSites()
{
var sampleSite = new Site("SampleSite");
var cnSubSite = new Site(sampleSite, "cn")
{
Bindings = new[] {
new Binding(){
Domain = "192.168.1.1",
SitePath = "cn"
}
}
};
siteProvider.Add(cnSubSite);
var childSites = siteProvider.ChildSites(sampleSite);
Assert.AreEqual(1, childSites.Count());
var actualSubSite = siteProvider.Get(cnSubSite);
Assert.AreEqual("SampleSite~cn", actualSubSite.AbsoluteName);
Assert.AreEqual("192.168.1.1", actualSubSite.Bindings[0].Domain);
Assert.AreEqual("cn", actualSubSite.Bindings[0].SitePath);
siteProvider.Remove(cnSubSite);
}
开发者ID:Kooboo,项目名称:Ovaldi,代码行数:27,代码来源:SiteProviderTests.cs
示例15: SiteDownloadContext
public SiteDownloadContext(Site site, DownloadOptions options, IList<PageLevel> downloadedPages, Queue<PageLevel> downloadQueue)
{
this.Site = site;
this.Options = options;
this.DownloadedPages = downloadedPages ?? new List<PageLevel>();
this.DownloadQueue = downloadQueue ?? new Queue<PageLevel>();
}
开发者ID:Kooboo,项目名称:Ovaldi,代码行数:7,代码来源:SiteDownloadContext.cs
示例16: Get
/// <summary>
/// Récupère une Site à partir d'un identifiant de client
/// </summary>
/// <param name="Identifiant">Identifant de Site</param>
/// <returns>Un Site </returns>
public static Site Get(Int32 identifiant)
{
//Connection
ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["EntretienSPPPConnectionString"];
SqlConnection connection = new SqlConnection(connectionStringSettings.ToString());
//Commande
String requete = @"SELECT Identifiant, Libelle, Adresse FROM Site
WHERE Identifiant = @Identifiant";
SqlCommand commande = new SqlCommand(requete, connection);
//Paramètres
commande.Parameters.AddWithValue("Identifiant", identifiant);
//Execution
connection.Open();
SqlDataReader dataReader = commande.ExecuteReader();
dataReader.Read();
//1 - Création du Site
Site site = new Site();
site.Identifiant = dataReader.GetInt32(0);
site.Libelle = dataReader.GetString(1);
site.Adresse = dataReader.GetString(2);
dataReader.Close();
connection.Close();
return site;
}
开发者ID:GroupeStageSPPP,项目名称:STAGE,代码行数:34,代码来源:SiteDB.cs
示例17: WriteWebsite
private void WriteWebsite(Site websiteObject)
{
SiteConfig config = WebsitesClient.GetWebsiteConfiguration(websiteObject.Name);
var diagnosticSettings = new DiagnosticsSettings();
try
{
diagnosticSettings = WebsitesClient.GetApplicationDiagnosticsSettings(websiteObject.Name);
}
catch
{
// Ignore exception and use default values
}
WebsiteInstance[] instanceIds;
try
{
instanceIds = WebsitesClient.ListWebsiteInstances(websiteObject.WebSpace, websiteObject.Name);
}
catch
{
// TODO: Temporary workaround for issue where slots are not supported with this API (yet).
instanceIds = new WebsiteInstance[0];
}
WriteObject(new SiteWithConfig(websiteObject, config, diagnosticSettings, instanceIds), false);
}
开发者ID:NordPool,项目名称:azure-sdk-tools,代码行数:27,代码来源:GetAzureWebSite.cs
示例18: ApplyRules
void ApplyRules(IEnumerable<StaticFile> staticFiles, Site site, string outputDirectory)
{
foreach (StaticFile staticFile in staticFiles) {
ApplyRouteRule(staticFile, site, outputDirectory);
ApplyCompileRule(staticFile, site);
}
}
开发者ID:wilsonmar,项目名称:mulder,代码行数:7,代码来源:Compiler.cs
示例19: CopySite
protected override Site CopySite(string sourceSiteId, string targetSiteName, string targetSiteDescription)
{
// Resolve source site id into its corresponding site object
Site sourceSite = SiteConfiguration.FindExistingSiteByID(sourceSiteId);
if (sourceSite == null)
throw new Exception("Unable to find site with siteId = " + sourceSiteId);
// Make sure target site directory does not already exist
string physicalPath = string.Format("{0}\\{1}", AppSettings.AppsPhysicalDir, targetSiteName);
if (System.IO.Directory.Exists(physicalPath))
throw new Exception("Site with name '" + targetSiteName + "' is in use already. Please try an alternate name.");
// Create a new site
Site targetSite = new Site();
targetSite.ID = Guid.NewGuid().ToString("N");
targetSite.IsHostedOnIIS = true;
targetSite.Name = targetSiteName;
targetSite.Description = targetSiteDescription;
targetSite.PhysicalPath = physicalPath;
targetSite.Url = string.Format("{0}/{1}", AppSettings.AppsBaseUrl.TrimEnd('/'), targetSiteName.TrimStart('/'));
targetSite.ProductVersion = sourceSite.ProductVersion;
// Copy files from source site directory to target site directory
FaultContract Fault = null;
if (!(new ApplicationBuilderHelper()).CopySite(sourceSite.PhysicalPath, targetSite, true, out Fault))
throw new Exception(Fault != null ? Fault.Message : "Unable to copy site");
// Update site database (XML file)
SiteConfiguration.AddSite(targetSite);
// Return target site object
return targetSite;
}
开发者ID:konglingjie,项目名称:arcgis-viewer-silverlight,代码行数:33,代码来源:CopySiteRequestHandler.cs
示例20: ExecuteCommand
internal override void ExecuteCommand()
{
Site website = null;
InvokeInOperationContext(() =>
{
website = RetryCall(s => Channel.GetSite(s, Name, null));
});
if (website == null)
{
throw new Exception(string.Format(Resources.InvalidWebsite, Name));
}
InvokeInOperationContext(() =>
{
Site websiteUpdate = new Site
{
Name = Name,
HostNames = new [] { Name + General.AzureWebsiteHostNameSuffix },
State = "Stopped"
};
RetryCall(s => Channel.UpdateSite(s, website.WebSpace, Name, websiteUpdate));
});
}
开发者ID:arri-cc,项目名称:azure-sdk-tools,代码行数:26,代码来源:StopAzureWebSite.cs
注:本文中的Site类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论