本文整理汇总了C#中Ra.Brix.Loader.ActiveEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# ActiveEventArgs类的具体用法?C# ActiveEventArgs怎么用?C# ActiveEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActiveEventArgs类属于Ra.Brix.Loader命名空间,在下文中一共展示了ActiveEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplicationStartup
protected static void ApplicationStartup(object sender, ActiveEventArgs e)
{
// Must do this just in case we've got "dead references" laying around ...
Users.Instance.Clear();
Language.Instance.SetDefaultValue("ButtonAdmin", "Admin");
Language.Instance.SetDefaultValue("ButtonAppl", "Applications");
}
示例2: SaveTwitterUsernameAndPassword
protected void SaveTwitterUsernameAndPassword(object sender, ActiveEventArgs e)
{
string username = e.Params["Username"].Get<string>();
string password = e.Params["Password"].Get<string>();
UserSettings.Instance["TwitterUsername", Users.LoggedInUserName] = username;
UserSettings.Instance["TwitterPassword", Users.LoggedInUserName] = password;
}
示例3: GetMenuItems
protected void GetMenuItems(object sender, ActiveEventArgs e)
{
e.Params["ButtonAppl"].Value = "Menu-Applications";
e.Params["ButtonAppl"]["ButtonChat"].Value = "Menu-Applications-Chat";
e.Params["ButtonAppl"]["ButtonChat"]["ButtonAvailableUsers"].Value = "Menu-OpenChat";
e.Params["ButtonAppl"]["ButtonChat"]["ButtonViewHistory"].Value = "Menu-OpenChatHistory";
}
示例4: Page_Init_InitialLoading
protected void Page_Init_InitialLoading(object sender, ActiveEventArgs e)
{
Page page = HttpContext.Current.Handler as Page;
// Injecting a CSS link reference if additional CSS files are to be included
string custFiles = Settings.Instance["CustomCssFiles"];
if (!string.IsNullOrEmpty(custFiles))
{
string[] files = custFiles.Split(
new char[] { ',' },
StringSplitOptions.RemoveEmptyEntries);
foreach (string file in files)
{
string fileName = file.Trim();
LiteralControl lit = new LiteralControl();
lit.Text = string.Format(@"
<link
href=""{0}""
rel=""stylesheet""
type=""text/css"" />",
fileName);
page.Header.Controls.Add(lit);
}
}
}
示例5: InitialLoadingOfPage
protected void InitialLoadingOfPage(object sender, ActiveEventArgs e)
{
if (HttpContext.Current.Request.Params["message"] != null)
{
string msgId = HttpContext.Current.Request.Params["message"];
string msg = Language.Instance[msgId];
Node nodeMessage = new Node();
nodeMessage["Message"].Value = msg;
nodeMessage["Duration"].Value = 2000;
ActiveEvents.Instance.RaiseActiveEvent(
this,
"ShowInformationMessage",
nodeMessage);
}
LoadMenu();
if (!string.IsNullOrEmpty(Users.LoggedInUserName))
{
Node node = new Node();
node["AddToExistingCollection"].Value = true;
node["ModuleSettings"]["Username"].Value = Users.LoggedInUserName;
ActiveEvents.Instance.RaiseLoadControl(
"LoginOpenIDModules.Logout",
"dynTop",
node);
}
else
{
LoadLoginModule();
}
}
示例6: DefaultCMSContentCreated
protected static void DefaultCMSContentCreated(object sender, ActiveEventArgs e)
{
AccessEntity a = new AccessEntity();
a.MenuValue = "url:~/";
a.RoleName = "Everyone";
a.Save();
}
示例7: CheckAccessToMenuItem
protected void CheckAccessToMenuItem(object sender, ActiveEventArgs e)
{
_accessEntities = new List<AccessEntity>(ActiveType<AccessEntity>.Select(Criteria.Eq("MenuValue", e.Params["MenuValue"].Value)));
User current = null;
if (!string.IsNullOrEmpty(Users.LoggedInUserName))
{
current = ActiveType<User>.SelectFirst(Criteria.Eq("Username", Users.LoggedInUserName));
}
bool hasAccess;
if (current == null)
{
hasAccess = _accessEntities.Exists(
delegate(AccessEntity idx)
{
return idx.RoleName == "Everyone";
});
}
else
{
hasAccess = current.InRole("Administrator") || _accessEntities.Exists(
delegate(AccessEntity idx)
{
return idx.RoleName == "Everyone" || current.InRole(idx.RoleName);
});
}
// Returning access back...
e.Params["DeniedAccess"].Value = !hasAccess;
}
示例8: ViewDetailsOfApplicationFile
protected void ViewDetailsOfApplicationFile(object sender, ActiveEventArgs e)
{
string fileFullPath = e.Params["FileFullPath"].Get<string>();
if (fileFullPath.IndexOf(".dll") != -1)
{
ReflectionHelper helper = new ReflectionHelper(fileFullPath);
Node node = helper.CreateNodeStructure();
Node input = new Node();
input["ModuleSettings"].Add(node[0]);
input["ModuleSettings"]["FileFullPath"].Value = fileFullPath;
ActiveEvents.Instance.RaiseLoadControl(
"InstalledAppsModules.ViewDetailsOfFile",
"dynMin",
input);
}
else
{
Node node = new Node();
node["Message"].Value =
Language.Instance["CannotViewNonDll", null, @"
You cannot view the details of a non-DLL file..."];
node["Duration"].Value = 5000;
ActiveEvents.Instance.RaiseActiveEvent(
this,
"ShowInformationMessage",
node);
}
}
示例9: Page_Init
protected static void Page_Init(object sender, ActiveEventArgs e)
{
Page page = HttpContext.Current.Handler as Page;
if (page != null)
{
if(!page.IsPostBack)
{
// Inject the Google Analytics tracking code...
string trackingID = Settings.Instance["GoogleAnalyticsTrackingID"];
if(!string.IsNullOrEmpty(trackingID))
{
string trackingCode = string.Format(@"
<script type=""text/javascript"">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{0}']);
_gaq.push(['_trackPageview']);
(function() {{
var ga = document.createElement('script');
ga.src = ('https:' == document.location.protocol ?
'https://ssl' : 'http://www') +
'.google-analytics.com/ga.js';
ga.setAttribute('async', 'true');
document.documentElement.firstChild.appendChild(ga);
}})();
</script>", trackingID);
LiteralControl ctrl = new LiteralControl();
ctrl.Text = trackingCode;
page.Form.Controls.Add(ctrl);
}
}
}
}
示例10: ApplicationStartup2
protected static void ApplicationStartup2(object sender, ActiveEventArgs e)
{
Language.Instance.SetDefaultValue("ButtonSkins", "Skins");
Language.Instance.SetDefaultValue("ButtonChangeSkin", "Change Skin");
Language.Instance.SetDefaultValue("ButtonDefaultSkin", "Set Default Skin");
Language.Instance.SetDefaultValue("ButtonUploadNewSkin", "Upload New Skin");
}
示例11: GetMenuItems
protected void GetMenuItems(object sender, ActiveEventArgs e)
{
e.Params["ButtonAdmin"]["ButtonSkins"].Value = "Menu-SkinRootFolder";
e.Params["ButtonAdmin"]["ButtonSkins"]["ButtonChangeSkin"].Value = "Menu-ChangeSkin";
e.Params["ButtonAdmin"]["ButtonSkins"]["ButtonDefaultSkin"].Value = "Menu-DefaultSkin";
e.Params["ButtonAdmin"]["ButtonSkins"]["ButtonUploadNewSkin"].Value = "Menu-UploadNewSkin";
}
示例12: CMSCommonPluginsSendEmail
protected void CMSCommonPluginsSendEmail(object sender, ActiveEventArgs e)
{
string smtpServer = Settings.Instance["SMTPServer"];
string smtpServerUsername = Settings.Instance["SMTPServerUsername"];
string smtpServerPassword = Settings.Instance["SMTPServerPassword"];
string smtpServerUseSsl = Settings.Instance["SMTPServerUseSsl"];
string adminEmail = Settings.Instance["AdminEmail"];
MailMessage msg = new MailMessage();
msg.To.Add(adminEmail);
msg.From = new MailAddress("[email protected]");
msg.Subject = Language.Instance["EmailDefaultSubjectLine", null, "Comment from: "] + e.Params["Name"].Get<string>();
msg.Body =
Language.Instance["ContactCredentials", null, "Contact credentials: "] +
e.Params["Email"].Get<string>() +
". " +
e.Params["Comment"].Get<string>()
+ @"
Promo Code: " + HttpContext.Current.Session["PromoCode"];
msg.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = smtpServer;
smtp.Credentials = new NetworkCredential(smtpServerUsername, smtpServerPassword);
smtp.EnableSsl = smtpServerUseSsl == "True";
smtp.Send(msg);
}
示例13: GetMenuItems
protected void GetMenuItems(object sender, ActiveEventArgs e)
{
GetClassesMenuItems(e);
e.Params["ButtonDocumentation"].Value = "Menu-ViewDocumentation";
if (_tutorials.Count == 0)
{
string root = HttpContext.Current.Server.MapPath("~/");
if (Directory.Exists(root + "tutorials"))
{
foreach (string fileName in Directory.GetFiles(root + "tutorials/", "*.txt"))
{
string[] tmpSplits = fileName.Split('-');
string tutorialName = tmpSplits[tmpSplits.Length - 1].Replace(".txt", "").Trim();
string tutorialUrl = tutorialName.Replace(" ", "-");
_tutorials[tutorialName] = "url:~/tutorials/" +
tutorialUrl.ToLower() +
ConfigurationManager.AppSettings["DefaultPageExtension"];
}
}
else
{
_hasTutorials = false;
}
}
if (_hasTutorials)
{
e.Params["ButtonTutorials"].Value = "tutorials";
foreach (string idxKey in _tutorials.Keys)
{
e.Params["ButtonTutorials"][idxKey].Value = _tutorials[idxKey];
}
}
}
示例14: ChangeUserLanguage
protected void ChangeUserLanguage(object sender, ActiveEventArgs e)
{
string language = e.Params["Language"].Get<string>();
Language.Instance.UserLanguage = language;
UserSettings.Instance["Language", Users.LoggedInUserName] = language;
AjaxManager.Instance.Redirect("~/?message=LanguageChanged");
}
示例15: ViewRSS
protected void ViewRSS(object sender, ActiveEventArgs e)
{
Node node = new Node();
node["TabCaption"].Value = Language.Instance["NewsFromTheWorld", null, "News from the world"];
int idxNo = 0;
foreach (Rss idx in RssDatabase.Database)
{
node["ModuleSettings"]["Items"]["Item" + idxNo]["Caption"].Value = idx.Title;
node["ModuleSettings"]["Items"]["Item" + idxNo]["Link"].Value = idx.WebLink;
node["ModuleSettings"]["Items"]["Item" + idxNo]["ID"].Value = idx.Id;
int idxNoItem = 0;
foreach (RssItem idxItem in idx.Items)
{
node["ModuleSettings"]["Items"]["Item" + idxNo]["Items"]["Item" + idxNoItem]["Caption"].Value = idxItem.Header;
node["ModuleSettings"]["Items"]["Item" + idxNo]["Items"]["Item" + idxNoItem]["Body"].Value = idxItem.Body;
node["ModuleSettings"]["Items"]["Item" + idxNo]["Items"]["Item" + idxNoItem]["Date"].Value = idxItem.Date;
node["ModuleSettings"]["Items"]["Item" + idxNo]["Items"]["Item" + idxNoItem]["URL"].Value = idxItem.Url;
idxNoItem += 1;
}
idxNo += 1;
}
ActiveEvents.Instance.RaiseLoadControl(
"RssReaderModules.ViewRSSItems",
"dynMid",
node);
}