当前位置: 首页>>代码示例>>C#>>正文


C# SiteConfig类代码示例

本文整理汇总了C#中SiteConfig的典型用法代码示例。如果您正苦于以下问题:C# SiteConfig类的具体用法?C# SiteConfig怎么用?C# SiteConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SiteConfig类属于命名空间,在下文中一共展示了SiteConfig类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAll

 public SiteConfig GetAll()
 {
     List<Option> options = _options.ToList();
     var model = new SiteConfig
     {
         AdminEmail = options.Where(op => op.Name.Equals("AdminEmail")).FirstOrDefault().Value,
         BlogDescription = options.Where(op => op.Name.Equals("BlogDescription")).FirstOrDefault().Value,
         BlogKeywords = options.Where(op => op.Name.Equals("BlogKeywords")).FirstOrDefault().Value,
         BlogName = options.Where(op => op.Name.Equals("BlogName")).FirstOrDefault().Value,
         CommentsNotify =
             Convert.ToBoolean(options.Where(op => op.Name.Equals("CommentsNotify")).FirstOrDefault().Value),
         CommentModeratingStatus =
             Convert.ToBoolean(options.Where(op => op.Name.Equals("CommentModeratingStatus"))
                 .FirstOrDefault().Value),
         MailServerLogin = options.Where(op => op.Name.Equals("MailServerLogin")).FirstOrDefault().Value,
         MailServerPass = options.Where(op => op.Name.Equals("MailServerPass")).FirstOrDefault().Value,
         MailServerPort =
             Convert.ToInt32(options.Where(op => op.Name.Equals("MailServerPort")).FirstOrDefault().Value),
         MailServerUrl = options.Where(op => op.Name.Equals("MailServerUrl")).FirstOrDefault().Value,
         PostPerPage =
             Convert.ToInt32(options.Where(op => op.Name.Equals("PostPerPage")).FirstOrDefault().Value),
         SiteUrl = options.Where(op => op.Name.Equals("SiteUrl")).FirstOrDefault().Value,
         UsersCanRegister = Convert.ToBoolean(options.Where(op => op.Name.Equals("UsersCanRegister"))
             .FirstOrDefault().Value)
     };
     return model;
 }
开发者ID:wria7,项目名称:IrisCms,代码行数:27,代码来源:OptionService.cs

示例2: ApplyClickThrough

        public static string ApplyClickThrough( SiteConfig siteConfig, string entryId, string content )
        {
            if ( siteConfig.EnableClickThrough && content != null && !SiteSecurity.IsValidContributor())
            {
                StringBuilder contentSb = new StringBuilder();
                int currentIndex = 0;
                foreach( Match match in FindHyperLinks(content) )
                {
                    contentSb.Append(content.Substring(currentIndex,match.Index-currentIndex));
                    currentIndex = match.Index+match.Length;
                    if(!match.Groups["postfix"].Value.Equals("\""))
                    {
                        // Patched with the {4} to avoid duplicated quotes at the end of the href
                        contentSb.AppendFormat("<a{0} href=\"{1}&amp;url={2}{4}{3}>",
                            match.Groups["prefix"].Value,GetClickThroughUrl(siteConfig, entryId),
                            HttpUtility.UrlEncode(HttpUtility.HtmlDecode(match.Groups["link"].Value)),
                            match.Groups["postfix"].Value,
                            (match.Groups["postfix"].Value.StartsWith("\"") ? "" : "\""));
                    }
                    else
                    {

                        contentSb.AppendFormat("<a{0} href=\"{1}&amp;url={2}\">",
                            match.Groups["prefix"].Value,GetClickThroughUrl(siteConfig, entryId),
                            HttpUtility.UrlEncode(HttpUtility.HtmlDecode(match.Groups["link"].Value)));
                    }
                }
                contentSb.Append(content.Substring(currentIndex));
                content = contentSb.ToString();
            }
            return content;
        }
开发者ID:AArnott,项目名称:dasblog,代码行数:32,代码来源:SiteUtilities.cs

示例3: PingbackAPI

 public PingbackAPI()
 {
     siteConfig = SiteConfig.GetSiteConfig();
     logDataService = LoggingDataServiceFactory.GetService(SiteConfig.GetLogPathFromCurrentContext());
     dataService = BlogDataServiceFactory.GetService(SiteConfig.GetContentPathFromCurrentContext(), logDataService);
     
 }
开发者ID:plntxt,项目名称:dasblog,代码行数:7,代码来源:PingbackAPI.cs

示例4: SiteControllerBase

 public SiteControllerBase()
 {
     Config = new SiteConfig();
     ViewBag.Config = Config;
     ViewBag.StylesheetUrls = Repository.Stylesheets.Select(u => Url.Action("display", "upload", new { category = u.Category, fileName = u.FileName }));
     ViewBag.LegacyStylesheetUrls = Repository.LegacyStylesheets.Select(u => Url.Action("display", "upload", new { category = u.Category, fileName = u.FileName }));
     ViewBag.ScriptUrls = Repository.Scripts.Select(u => Url.Action("display", "upload", new { category = u.Category, fileName = u.FileName }));
 }
开发者ID:peders,项目名称:Imprint-CMS,代码行数:8,代码来源:SiteControllerBase.cs

示例5: Index

 public virtual ActionResult Index(SiteConfig model)
 {
     _optionService.Update(model);
     _uow.SaveChanges();
     _cacheService.RemoveSiteConfig();
     return PartialView(MVC.Admin.Shared.Views._Alert, new Alert
     {
         Message = "تنظیمات سایت با موفقیت به روز رسانی شد",
         Mode = AlertMode.Success
     });
 }
开发者ID:wria7,项目名称:IrisCms,代码行数:11,代码来源:OptionController.cs

示例6: SerializeTest

		public void SerializeTest(){

			SiteConfig config = new SiteConfig();

			XmlSerializer ser = new XmlSerializer(typeof(SiteConfig));

			using( StringWriter writer = new StringWriter() ){

				ser.Serialize( writer, config );

				//Debug.Write( writer.ToString() );
			}
			


		}
开发者ID:plntxt,项目名称:dasblog,代码行数:16,代码来源:SiteConfigSerializeTest.cs

示例7: ShowInfo

    private void ShowInfo()
    {
        SiteConfig bll = new SiteConfig();
        Com_Config model = bll.loadConfig(Utils.GetXmlMapPath(LoneuKeys.FILE_SITE_XML_CONFING));
        webname.Text = model.webname;
        webcompany.Text = model.webcompany;
        weburl.Text = model.weburl;
        webtel.Text = model.webtel;
        webfax.Text = model.webfax;
        webmail.Text = model.webmail;
        webcrod.Text = model.webcrod;
        webtitle.Text = model.webtitle;
        webkeyword.Text = model.webkeyword;
        webdescription.Text = model.webdescription;
        webcopyright.Text = model.webcopyright;
       
        emailstmp.Text = model.emailstmp;
        emailport.Text = model.emailport.ToString();
        emailfrom.Text = model.emailfrom;
        emailusername.Text = model.emailusername;
        if (!string.IsNullOrEmpty(model.emailpassword))
        {
            emailpassword.Attributes["value"] = defaultpassword;
        }
        emailnickname.Text = model.emailnickname;

        attachpath.Text = model.attachpath;
        attachextension.Text = model.attachextension;
        attachsave.SelectedValue = model.attachsave.ToString();
        attachfilesize.Text = model.attachfilesize.ToString();
        attachimgsize.Text = model.attachimgsize.ToString();
        attachimgmaxheight.Text = model.attachimgmaxheight.ToString();
        attachimgmaxwidth.Text = model.attachimgmaxwidth.ToString();
        thumbnailheight.Text = model.thumbnailheight.ToString();
        thumbnailwidth.Text = model.thumbnailwidth.ToString();
        watermarktype.SelectedValue = model.watermarktype.ToString();
        watermarkposition.Text = model.watermarkposition.ToString();
        watermarkimgquality.Text = model.watermarkimgquality.ToString();
        watermarkpic.Text = model.watermarkpic;
        watermarktransparency.Text = model.watermarktransparency.ToString();
        watermarktext.Text = model.watermarktext;
        watermarkfont.Text = model.watermarkfont;
        watermarkfontsize.Text = model.watermarkfontsize.ToString();
    }
开发者ID:summer-breeze,项目名称:Oodso,代码行数:44,代码来源:SysConfig.aspx.cs

示例8: ExecuteCmdlet

        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            SiteConfig siteConfig = null;
            string location = null;
            switch (ParameterSetName)
            {
                case ParameterSet1Name:
                    WebApp = WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot);
                    location = WebApp.Location;
                    var parameters = new HashSet<string>(MyInvocation.BoundParameters.Keys, StringComparer.OrdinalIgnoreCase);
                    if (parameters.Any(p => CmdletHelpers.SiteConfigParameters.Contains(p)))
                    {
                        siteConfig = new SiteConfig
                        {
                            DefaultDocuments = parameters.Contains("DefaultDocuments") ? DefaultDocuments : null,
                            NetFrameworkVersion = parameters.Contains("NetFrameworkVersion") ? NetFrameworkVersion : null,
                            PhpVersion = parameters.Contains("PhpVersion") ? PhpVersion : null,
                            RequestTracingEnabled =
                                parameters.Contains("RequestTracingEnabled") ? (bool?)RequestTracingEnabled : null,
                            HttpLoggingEnabled = parameters.Contains("HttpLoggingEnabled") ? (bool?)HttpLoggingEnabled : null,
                            DetailedErrorLoggingEnabled =
                                parameters.Contains("DetailedErrorLoggingEnabled") ? (bool?)DetailedErrorLoggingEnabled : null,
                            HandlerMappings = parameters.Contains("HandlerMappings") ? HandlerMappings : null,
                            ManagedPipelineMode =
                                parameters.Contains("ManagedPipelineMode")
                                    ? (ManagedPipelineMode?)Enum.Parse(typeof(ManagedPipelineMode), ManagedPipelineMode)
                                    : null,
                            WebSocketsEnabled = parameters.Contains("WebSocketsEnabled") ? (bool?)WebSocketsEnabled : null,
                            Use32BitWorkerProcess =
                                parameters.Contains("Use32BitWorkerProcess") ? (bool?)Use32BitWorkerProcess : null
                        };
                    }

                    // Update web app configuration
                    WebsitesClient.UpdateWebAppConfiguration(ResourceGroupName, location, Name, Slot, siteConfig, AppSettings.ConvertToStringDictionary(), ConnectionStrings.ConvertToConnectionStringDictionary());

                    if (parameters.Contains("AppServicePlan"))
                    {
                        WebsitesClient.UpdateWebApp(ResourceGroupName, location, Name, Slot, AppServicePlan);
                    }


                    break;
                case ParameterSet2Name:
                    // Web app is direct or pipeline input
                    string servicePlanName;
                    string rg;
                    location = WebApp.Location;
                    siteConfig = WebApp.SiteConfig;

                    // Update web app configuration
                    WebsitesClient.UpdateWebAppConfiguration(ResourceGroupName, location, Name, Slot, siteConfig, WebApp.SiteConfig == null ? null : WebApp.SiteConfig.AppSettings.ToDictionary(nvp => nvp.Name, nvp => nvp.Value, StringComparer.OrdinalIgnoreCase), WebApp.SiteConfig == null ? null : WebApp.SiteConfig.ConnectionStrings.ToDictionary(nvp => nvp.Name, nvp => new ConnStringValueTypePair { Type = nvp.Type, Value = nvp.ConnectionString }, StringComparer.OrdinalIgnoreCase));

                    CmdletHelpers.TryParseAppServicePlanMetadataFromResourceId(WebApp.ServerFarmId, out rg, out servicePlanName);
                    WebsitesClient.UpdateWebApp(ResourceGroupName, location, Name, Slot, servicePlanName);
                    break;
            }

            WriteObject(WebsitesClient.GetWebApp(ResourceGroupName, Name, Slot));
        }
开发者ID:docschmidt,项目名称:azure-powershell,代码行数:61,代码来源:SetAzureWebAppSlot.cs

示例9: createSiteConfigWithFilter

		private SiteConfig createSiteConfigWithFilter(string expression, string mapTo, bool isRegularExpression)
		{
			SiteConfig siteConfig = new SiteConfig();
			siteConfig.ContentFilters.Add(createContentFilter(expression, mapTo, isRegularExpression));
			return siteConfig;
		}
开发者ID:plntxt,项目名称:dasblog,代码行数:6,代码来源:UtilitiesTests.cs

示例10: UpdateEntry

 public static EntrySaveState UpdateEntry(Entry entry, string trackbackUrl, CrosspostInfoCollection crosspostList, SiteConfig siteConfig, ILoggingDataService logService, IBlogDataService dataService)
 {
     return SiteUtilities.UpdateEntry(entry,trackbackUrl,crosspostList,siteConfig,logService,dataService);
 }
开发者ID:AArnott,项目名称:dasblog,代码行数:4,代码来源:Utils.cs

示例11: UpdateSiteConfig

 public static void UpdateSiteConfig(this IWebsitesServiceManagement proxy, string subscriptionName, string webspaceName, string name, SiteConfig siteConfig)
 {
     proxy.EndUpdateSiteConfig(proxy.BeginUpdateSiteConfig(subscriptionName, webspaceName, name, siteConfig, null, null));
 }
开发者ID:nicopeelen,项目名称:azure-sdk-tools,代码行数:4,代码来源:WebsitesExtensionMethods.cs

示例12: UpdateSiteConfig

        public void UpdateSiteConfig(SiteConfig siteConfig)
        {
            SiteConfig currentSiteConfig = SiteConfig.GetSiteConfig();
            if ( !currentSiteConfig.EnableConfigEditService )
            {
                throw new ServiceDisabledException();
            }

            if (authenticationHeader == null || 
                SiteSecurity.Login(authenticationHeader.userName, authenticationHeader.password).Role != "admin")
            {
                throw new Exception("Invalid Password");
            }

            XmlSerializer ser = new XmlSerializer(typeof(SiteConfig));

            using (StreamWriter writer = new StreamWriter(SiteConfig.GetConfigFilePathFromCurrentContext()))
            {
                ser.Serialize(writer, siteConfig);
            }
        }
开发者ID:plntxt,项目名称:dasblog,代码行数:21,代码来源:ConfigEditingServiceImplementation.cs

示例13: ToSiteConfig

 internal static SiteConfig ToSiteConfig(this WebSiteGetConfigurationResponse getConfigResponse)
 {
     var config = new SiteConfig
     {
         NumberOfWorkers = getConfigResponse.NumberOfWorkers,
         DefaultDocuments = getConfigResponse.DefaultDocuments.ToArray(),
         NetFrameworkVersion = getConfigResponse.NetFrameworkVersion,
         PhpVersion = getConfigResponse.PhpVersion,
         RequestTracingEnabled = getConfigResponse.RequestTracingEnabled,
         HttpLoggingEnabled = getConfigResponse.HttpLoggingEnabled,
         DetailedErrorLoggingEnabled = getConfigResponse.DetailedErrorLoggingEnabled,
         PublishingUsername = getConfigResponse.PublishingUserName,
         PublishingPassword = getConfigResponse.PublishingPassword,
         AppSettings = getConfigResponse.AppSettings.Select(ToNameValuePair).ToList(),
         Metadata = getConfigResponse.Metadata.Select(ToNameValuePair).ToList(),
         ConnectionStrings = new ConnStringPropertyBag(
             getConfigResponse.ConnectionStrings.Select(cs => new ConnStringInfo
             {
                 ConnectionString = cs.ConnectionString,
                 Name = cs.Name,
                 Type = (DatabaseType)Enum.Parse(typeof(DatabaseType), cs.Type)
             }).ToList()),
         HandlerMappings = getConfigResponse.HandlerMappings.Select(hm => new HandlerMapping
         {
             Arguments = hm.Arguments,
             Extension = hm.Extension,
             ScriptProcessor = hm.ScriptProcessor
         }).ToArray(),
         ManagedPipelineMode = getConfigResponse.ManagedPipelineMode,
         WebSocketsEnabled = getConfigResponse.WebSocketsEnabled,
         RemoteDebuggingEnabled = getConfigResponse.RemoteDebuggingEnabled,
         RemoteDebuggingVersion = getConfigResponse.RemoteDebuggingVersion.GetValueOrDefault()
     };
     return config;
 }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:35,代码来源:WebSitesManagementExtensionMethods.cs

示例14: SyndicationServiceExperimentalImplementation

 public SyndicationServiceExperimentalImplementation(SiteConfig siteConfig, IBlogDataService dataService, ILoggingDataService loggingService):
     base( siteConfig, dataService, loggingService )
 {
     //CODEGEN: This call is required by the ASP.NET Web Services Designer
     InitializeComponent();
 }
开发者ID:plntxt,项目名称:dasblog,代码行数:6,代码来源:SyndicationServiceExperimentalImplementation.cs

示例15: SendEmailReport

        public void SendEmailReport(DateTime reportDate, SiteConfig siteConfig, IBlogDataService dataService, ILoggingDataService loggingService)
        {
            MailMessage emailMessage = new MailMessage();
            if ( siteConfig.NotificationEMailAddress != null && siteConfig.NotificationEMailAddress.Length > 0 )
            {
                emailMessage.To.Add(siteConfig.NotificationEMailAddress);
            }
            else
            {
                emailMessage.To.Add(siteConfig.Contact);
            }

            emailMessage.Subject = String.Format("Weblog Daily Activity Report for '{0}'", reportDate.ToLongDateString());
            emailMessage.Body = GenerateReportEmailBody(reportDate);
            emailMessage.IsBodyHtml = true;
            emailMessage.BodyEncoding = System.Text.Encoding.UTF8;
            emailMessage.From = new MailAddress(siteConfig.Contact);

            SendMailInfo sendMailInfo = new SendMailInfo(emailMessage, siteConfig.SmtpServer,
                siteConfig.EnableSmtpAuthentication, siteConfig.UseSSLForSMTP, siteConfig.SmtpUserName, siteConfig.SmtpPassword, siteConfig.SmtpPort);

            dataService.AddTracking(null, sendMailInfo ); // use this with null tracking object, just to get the email sent
            loggingService.AddEvent( new EventDataItem( EventCodes.ReportMailerReportSent,"",""));
        }
开发者ID:AArnott,项目名称:dasblog,代码行数:24,代码来源:ReportMailer.cs


注:本文中的SiteConfig类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。