現在、私はsharepoint 2010を使用しており、以下のコードを使用してサイトのテーマの色を取得しましたが、デフォルト(テーマなし)を取得すると例外(テーマのURLがnull)が発生します。デフォルトの色(テーマなし)を取得するのを手伝ってください。
using (SPSite site = new SPSite(this.Context.Request.Url.ToString()))
{
using (SPWeb web = site.OpenWeb())
{
string urlTheme = ThmxTheme.GetThemeUrlForWeb(web);
using (ThmxTheme thmxTheme = ThmxTheme.Open(web.Site, urlTheme))
{
dark2 = thmxTheme.DarkColor2.DefaultColor.Name;
}
}
}
ありがとう、