本文整理汇总了C#中DotNetNuke.Entities.Tabs.TabController.CreateLocalizedCopy方法的典型用法代码示例。如果您正苦于以下问题:C# TabController.CreateLocalizedCopy方法的具体用法?C# TabController.CreateLocalizedCopy怎么用?C# TabController.CreateLocalizedCopy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DotNetNuke.Entities.Tabs.TabController
的用法示例。
在下文中一共展示了TabController.CreateLocalizedCopy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: cmdUpdate_Click
protected void cmdUpdate_Click(object sender, EventArgs e)
{
try
{
if (UserInfo.IsSuperUser)
{
//Update Language
if (Language == null)
{
_Language = LocaleController.Instance.GetLocale(languageComboBox.SelectedValue);
if (_Language == null)
{
_Language = new Locale();
Language.Code = languageComboBox.SelectedValue;
}
}
Language.Fallback = fallBackComboBox.SelectedValue;
Language.Text = CultureInfo.CreateSpecificCulture(Language.Code).NativeName;
Localization.SaveLanguage(Language);
}
if (!IsLanguageEnabled(Language.Code))
{
//Add language to portal
Localization.AddLanguageToPortal(PortalId, Language.LanguageId, true);
}
string roles = Null.NullString;
if (IsAddMode)
{
roles = string.Format("Administrators;{0}", string.Format("Translator ({0})", Language.Code));
}
else
{
foreach (string role in translatorRoles.SelectedRoleNames)
{
roles += role + ";";
}
roles = roles.TrimEnd(';');
}
PortalController.UpdatePortalSetting(PortalId, string.Format("DefaultTranslatorRoles-{0}", Language.Code), roles);
var tabCtrl = new TabController();
TabCollection tabs = tabCtrl.GetTabsByPortal(PortalId).WithCulture(Language.Code, false);
if (PortalSettings.ContentLocalizationEnabled && tabs.Count == 0)
{
//Create Localized Pages
foreach (TabInfo t in tabCtrl.GetCultureTabList(PortalId))
{
tabCtrl.CreateLocalizedCopy(t, Language);
}
var portalCtl = new PortalController();
portalCtl.MapLocalizedSpecialPages(PortalId, Language.Code);
}
Response.Redirect(Globals.NavigateURL(), true);
//Module failed to load
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
示例2: ProcessLanguage
private void ProcessLanguage(List<TabInfo> pageList, Locale locale, int languageCount, int totalLanguages)
{
try
{
var tabCtrl = new TabController();
RadProgressContext progress = RadProgressContext.Current;
progress.Speed = "N/A";
progress.PrimaryTotal = totalLanguages;
progress.PrimaryValue = languageCount;
int total = pageList.Count;
for (int i = 0; i <= total - 1; i++)
{
TabInfo currentTab = pageList[i];
int stepNo = i + 1;
progress.SecondaryTotal = total;
progress.SecondaryValue = stepNo;
float secondaryPercent = ((float)stepNo / (float)total) * 100;
progress.SecondaryPercent = Convert.ToInt32(secondaryPercent);
float primaryPercent = ((((float)languageCount + ((float)stepNo / (float)total)) / (float)totalLanguages)) * 100;
progress.PrimaryPercent = Convert.ToInt32(primaryPercent);
progress.CurrentOperationText = string.Format(Localization.GetString("ProcessingPage", LocalResourceFile), locale.Code, stepNo, total, currentTab.TabName);
if (!Response.IsClientConnected)
{
//clear cache
DataCache.ClearPortalCache(PortalId, true);
//Cancel button was clicked or the browser was closed, so stop processing
break;
}
progress.TimeEstimated = (total - stepNo) * 100;
tabCtrl.CreateLocalizedCopy(currentTab, locale, false);
}
var portalCtl = new PortalController();
portalCtl.MapLocalizedSpecialPages(PortalId, locale.Code);
}
catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
示例3: ProcessLanguage
private void ProcessLanguage(List<TabInfo> pageList, Locale locale, int languageCount, int totalLanguages)
{
var tabCtrl = new TabController();
RadProgressContext progress = RadProgressContext.Current;
progress.Speed = "N/A";
progress.PrimaryTotal = totalLanguages;
progress.PrimaryValue = languageCount;
int total = pageList.Count;
for (int i = 0; i <= total - 1; i++)
{
TabInfo currentTab = pageList[i];
int stepNo = i + 1;
progress.SecondaryTotal = total;
progress.SecondaryValue = stepNo;
float secondaryPercent = ((float) stepNo/(float) total) * 100;
progress.SecondaryPercent = Convert.ToInt32(secondaryPercent);
float primaryPercent = ((((float)languageCount + ((float)stepNo / (float)total)) / (float)totalLanguages)) * 100;
progress.PrimaryPercent = Convert.ToInt32(primaryPercent);
progress.CurrentOperationText = string.Format(Localization.GetString("ProcessingPage", LocalResourceFile), locale.Code, stepNo, total, currentTab.TabName);
if (!Response.IsClientConnected)
{
//Cancel button was clicked or the browser was closed, so stop processing
break;
}
progress.TimeEstimated = (total - stepNo)*100;
tabCtrl.CreateLocalizedCopy(currentTab, locale);
//Add a delay for debug testing
//Threading.Thread.Sleep(500)
}
}