本文整理汇总了C#中WhiteCore.Modules.Web.WebInterface.UserTypeArgs方法的典型用法代码示例。如果您正苦于以下问题:C# WebInterface.UserTypeArgs方法的具体用法?C# WebInterface.UserTypeArgs怎么用?C# WebInterface.UserTypeArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WhiteCore.Modules.Web.WebInterface
的用法示例。
在下文中一共展示了WebInterface.UserTypeArgs方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Fill
//.........这里部分代码省略.........
bool TempUserBanned = false;
if (userBanned)
{
if ((agent.Flags & IAgentFlags.TempBan) == IAgentFlags.TempBan &&
agent.OtherAgentInformation["TemperaryBanInfo"].AsDate() < DateTime.Now.ToUniversalTime())
{
userBanned = false;
agent.Flags &= ~IAgentFlags.TempBan;
agent.Flags &= ~IAgentFlags.PermBan;
agent.OtherAgentInformation.Remove("TemperaryBanInfo");
agentService.UpdateAgent(agent);
}
else
{
DateTime bannedTime = agent.OtherAgentInformation["TemperaryBanInfo"].AsDate();
TempUserBanned = bannedTime != Util.UnixEpoch;
bannedUntil = string.Format("{0} {1}", bannedTime.ToShortDateString(), bannedTime.ToLongTimeString());
}
}
bool userOnline = false;
IAgentInfoService agentInfoService = webInterface.Registry.RequestModuleInterface<IAgentInfoService>();
if (agentInfoService != null)
{
UserInfo info = agentInfoService.GetUserInfo(account.PrincipalID.ToString());
userOnline = info != null ? info.IsOnline : false;
}
vars.Add("UserOnline", userOnline);
vars.Add("NotUserBanned", !userBanned);
vars.Add("UserBanned", userBanned);
vars.Add("TempUserBanned", TempUserBanned);
vars.Add("BannedUntil", bannedUntil);
vars.Add("EmailValue", account.Email);
vars.Add("UserID", account.PrincipalID);
vars.Add("UserName", account.Name);
vars.Add("ErrorMessage", error);
vars.Add("ChangeUserInformationText", translator.GetTranslatedString("ChangeUserInformationText"));
vars.Add("ChangePasswordText", translator.GetTranslatedString("ChangePasswordText"));
vars.Add("NewPasswordText", translator.GetTranslatedString("NewPasswordText"));
vars.Add("NewPasswordConfirmationText", translator.GetTranslatedString("NewPasswordConfirmationText"));
vars.Add("ChangeEmailText", translator.GetTranslatedString("ChangeEmailText"));
vars.Add("NewEmailText", translator.GetTranslatedString("NewEmailText"));
vars.Add("UserNameText", translator.GetTranslatedString("UserNameText"));
vars.Add("PasswordText", translator.GetTranslatedString("PasswordText"));
vars.Add("DeleteUserText", translator.GetTranslatedString("DeleteUserText"));
vars.Add("DeleteText", translator.GetTranslatedString("DeleteText"));
vars.Add("DeleteUserInfoText", translator.GetTranslatedString("DeleteUserInfoText"));
vars.Add("Submit", translator.GetTranslatedString("Submit"));
vars.Add("Login", translator.GetTranslatedString("Login"));
vars.Add("TypeUserNameToConfirm", translator.GetTranslatedString("TypeUserNameToConfirm"));
vars.Add("AdminUserTypeInfoText",translator.GetTranslatedString("AdminUserTypeInfoText"));
vars.Add("AdminSetUserTypeText", translator.GetTranslatedString("UserTypeText"));
vars.Add("AdminLoginInAsUserText", translator.GetTranslatedString("AdminLoginInAsUserText"));
vars.Add("AdminLoginInAsUserInfoText", translator.GetTranslatedString("AdminLoginInAsUserInfoText"));
vars.Add("AdminDeleteUserText", translator.GetTranslatedString("AdminDeleteUserText"));
vars.Add("AdminDeleteUserInfoText", translator.GetTranslatedString("AdminDeleteUserInfoText"));
vars.Add("AdminUnbanUserText", translator.GetTranslatedString("AdminUnbanUserText"));
vars.Add("AdminTempBanUserText", translator.GetTranslatedString("AdminTempBanUserText"));
vars.Add("AdminTempBanUserInfoText", translator.GetTranslatedString("AdminTempBanUserInfoText"));
vars.Add("AdminBanUserText", translator.GetTranslatedString("AdminBanUserText"));
vars.Add("AdminBanUserInfoText", translator.GetTranslatedString("AdminBanUserInfoText"));
vars.Add("BanText", translator.GetTranslatedString("BanText"));
vars.Add("UnbanText", translator.GetTranslatedString("UnbanText"));
vars.Add("TimeUntilUnbannedText", translator.GetTranslatedString("TimeUntilUnbannedText"));
vars.Add("EdittingText", translator.GetTranslatedString("EdittingText"));
vars.Add("BannedUntilText", translator.GetTranslatedString("BannedUntilText"));
vars.Add("KickAUserInfoText", translator.GetTranslatedString("KickAUserInfoText"));
vars.Add("KickAUserText", translator.GetTranslatedString("KickAUserText"));
vars.Add("KickMessageText", translator.GetTranslatedString("KickMessageText"));
vars.Add("KickUserText", translator.GetTranslatedString("KickUserText"));
vars.Add("MessageAUserText", translator.GetTranslatedString("MessageAUserText"));
vars.Add("MessageAUserInfoText", translator.GetTranslatedString("MessageAUserInfoText"));
vars.Add("MessageUserText", translator.GetTranslatedString("MessageUserText"));
List<Dictionary<string, object>> daysArgs = new List<Dictionary<string, object>>();
for (int i = 0; i <= 100; i++)
daysArgs.Add(new Dictionary<string, object> {{"Value", i}});
List<Dictionary<string, object>> hoursArgs = new List<Dictionary<string, object>>();
for (int i = 0; i <= 23; i++)
hoursArgs.Add(new Dictionary<string, object> {{"Value", i}});
List<Dictionary<string, object>> minutesArgs = new List<Dictionary<string, object>>();
for (int i = 0; i <= 59; i++)
minutesArgs.Add(new Dictionary<string, object> {{"Value", i}});
vars.Add("Days", daysArgs);
vars.Add("Hours", hoursArgs);
vars.Add("Minutes", minutesArgs);
vars.Add("DaysText", translator.GetTranslatedString("DaysText"));
vars.Add("HoursText", translator.GetTranslatedString("HoursText"));
vars.Add("MinutesText", translator.GetTranslatedString("MinutesText"));
vars.Add("UserType", webInterface.UserTypeArgs(translator));
return vars;
}
示例2: Fill
//.........这里部分代码省略.........
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Nov_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Dec_Short")}});
List<Dictionary<string, object>> yearsArgs = new List<Dictionary<string, object>>();
for (int i = 1940; i <= 2013; i++)
yearsArgs.Add(new Dictionary<string, object> {{"Value", i}});
vars.Add("Days", daysArgs);
vars.Add("Months", monthsArgs);
vars.Add("Years", yearsArgs);
var sortBy = new Dictionary<string, bool>();
sortBy.Add("RegionName", true);
var RegionListVars = new List<Dictionary<string, object>>();
var regions = Framework.Utilities.DataManager.RequestPlugin<IRegionData>().Get((RegionFlags) 0,
RegionFlags.Hyperlink |
RegionFlags.Foreign |
RegionFlags.Hidden,
null, null, sortBy);
foreach (var region in regions)
{
RegionListVars.Add (new Dictionary<string, object> {
{ "RegionName", region.RegionName },
{ "RegionUUID", region.RegionID }
});
}
vars.Add("RegionList", RegionListVars);
vars.Add("UserHomeRegionText", translator.GetTranslatedString("UserHomeRegionText"));
vars.Add("UserTypeText", translator.GetTranslatedString("UserTypeText"));
vars.Add("UserType", webInterface.UserTypeArgs(translator)) ;
List<AvatarArchive> archives = webInterface.Registry.RequestModuleInterface<IAvatarAppearanceArchiver>().GetAvatarArchives();
List<Dictionary<string, object>> avatarArchives = new List<Dictionary<string, object>>();
IWebHttpTextureService webTextureService = webInterface.Registry.
RequestModuleInterface<IWebHttpTextureService>();
foreach (var archive in archives)
avatarArchives.Add(new Dictionary<string, object>
{
{"AvatarArchiveName", archive.FolderName },
{"AvatarArchiveSnapshotID", archive.Snapshot},
{
"AvatarArchiveSnapshotURL",
webTextureService.GetTextureURL(archive.Snapshot)
}
});
vars.Add("AvatarArchive", avatarArchives);
IConfig loginServerConfig =
webInterface.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource.Configs["LoginService"];
string tosLocation = "";
if (loginServerConfig != null && loginServerConfig.GetBoolean("UseTermsOfServiceOnFirstLogin", false))
{
tosLocation = loginServerConfig.GetString("FileNameOfTOS", "");
tosLocation = PathHelpers.VerifyReadFile (tosLocation, ".txt", Constants.DEFAULT_DATA_DIR);
}
string ToS = "There are no Terms of Service currently. This may be changed at any point in the future.";
if (tosLocation != "")
{
System.IO.StreamReader reader =
示例3: Fill
//.........这里部分代码省略.........
}
else
response = "<h3>" + error + "</h3>";
}
else
response = "<h3>You did not accept the Terms of Service agreement.</h3>";
return null;
}
List<Dictionary<string, object>> daysArgs = new List<Dictionary<string, object>>();
for (int i = 1; i <= 31; i++)
daysArgs.Add(new Dictionary<string, object> {{"Value", i}});
List<Dictionary<string, object>> monthsArgs = new List<Dictionary<string, object>>();
//for (int i = 1; i <= 12; i++)
// monthsArgs.Add(new Dictionary<string, object> {{"Value", i}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Jan_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Feb_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Mar_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Apr_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("May_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Jun_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Jul_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Aug_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Sep_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Oct_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Nov_Short")}});
monthsArgs.Add(new Dictionary<string, object> {{"Value", translator.GetTranslatedString("Dec_Short")}});
List<Dictionary<string, object>> yearsArgs = new List<Dictionary<string, object>>();
for (int i = 1940; i <= 2013; i++)
yearsArgs.Add(new Dictionary<string, object> {{"Value", i}});
vars.Add("Days", daysArgs);
vars.Add("Months", monthsArgs);
vars.Add("Years", yearsArgs);
vars.Add("UserTypeText", translator.GetTranslatedString("UserTypeText"));
vars.Add("UserType", webInterface.UserTypeArgs(translator)) ;
List<AvatarArchive> archives = webInterface.Registry.RequestModuleInterface<IAvatarAppearanceArchiver>().GetAvatarArchives();
List<Dictionary<string, object>> avatarArchives = new List<Dictionary<string, object>>();
IWebHttpTextureService webTextureService = webInterface.Registry.
RequestModuleInterface<IWebHttpTextureService>();
foreach (var archive in archives)
avatarArchives.Add(new Dictionary<string, object>
{
{"AvatarArchiveName", archive.FileName },
{"AvatarArchiveSnapshotID", archive.Snapshot},
{
"AvatarArchiveSnapshotURL",
webTextureService.GetTextureURL(archive.Snapshot)
}
});
vars.Add("AvatarArchive", avatarArchives);
IConfig loginServerConfig =
webInterface.Registry.RequestModuleInterface<ISimulationBase>().ConfigSource.Configs["LoginService"];
string tosLocation = "";
if (loginServerConfig != null && loginServerConfig.GetBoolean("UseTermsOfServiceOnFirstLogin", false))
tosLocation = loginServerConfig.GetString("FileNameOfTOS", "");
string ToS = "There are no Terms of Service currently. This may be changed at any point in the future.";
if (tosLocation != "")
{
System.IO.StreamReader reader =
new System.IO.StreamReader(System.IO.Path.Combine(Environment.CurrentDirectory, tosLocation));
ToS = reader.ReadToEnd();
reader.Close();
}
vars.Add("ToSMessage", ToS);
vars.Add("TermsOfServiceAccept", translator.GetTranslatedString("TermsOfServiceAccept"));
vars.Add("TermsOfServiceText", translator.GetTranslatedString("TermsOfServiceText"));
vars.Add("RegistrationsDisabled", "");
//vars.Add("RegistrationsDisabled", translator.GetTranslatedString("RegistrationsDisabled"));
vars.Add("RegistrationText", translator.GetTranslatedString("RegistrationText"));
vars.Add("AvatarNameText", translator.GetTranslatedString("AvatarNameText"));
vars.Add("AvatarPasswordText", translator.GetTranslatedString("Password"));
vars.Add("AvatarPasswordConfirmationText", translator.GetTranslatedString("PasswordConfirmation"));
vars.Add("AvatarScopeText", translator.GetTranslatedString("AvatarScopeText"));
vars.Add("FirstNameText", translator.GetTranslatedString("FirstNameText"));
vars.Add("LastNameText", translator.GetTranslatedString("LastNameText"));
vars.Add("UserAddressText", translator.GetTranslatedString("UserAddressText"));
vars.Add("UserZipText", translator.GetTranslatedString("UserZipText"));
vars.Add("UserCityText", translator.GetTranslatedString("UserCityText"));
vars.Add("UserCountryText", translator.GetTranslatedString("UserCountryText"));
vars.Add("UserDOBText", translator.GetTranslatedString("UserDOBText"));
vars.Add("UserEmailText", translator.GetTranslatedString("UserEmailText"));
vars.Add("Accept", translator.GetTranslatedString("Accept"));
vars.Add("Submit", translator.GetTranslatedString("Submit"));
vars.Add("SubmitURL", "register.html");
vars.Add("ErrorMessage", "");
vars.Add("Registrations", true);
vars.Add("NoRegistrations", false);
return vars;
}