public IEnumerable<SelectOption> Get() { var feeds = new List<SelectOption>(); var feedSets = ExtensionManager.GetSettings(_metaExtension, _galleryFeeds); var feedService = "http://dnbe.net/v01/nuget"; if (!string.IsNullOrEmpty(BlogSettings.Instance.GalleryFeedUrl)) feedService = BlogSettings.Instance.GalleryFeedUrl; if (feedSets == null) { var settings = new ExtensionSettings(_galleryFeeds); settings.AddParameter("OptionName", "Title", 150, true, true); settings.AddParameter("OptionValue"); settings.AddValues(new[] { "dnbe.net", feedService }); feedSets = ExtensionManager.InitSettings(_metaExtension, settings); ExtensionManager.SaveSettings(_metaExtension, feedSets); } var table = feedSets.GetDataTable(); foreach (DataRow row in table.Rows) { feeds.Add(new SelectOption { OptionName = row[0].ToString(), OptionValue = row[1].ToString() }); } return feeds; }
/// <summary> /// Get list of custom filters /// </summary> /// <returns>List of filters</returns> public static List<JsonCustomFilter> GetCustomFilters() { var filterList = new List<JsonCustomFilter>(); try { CustomFilters = ExtensionManager.GetSettings("MetaExtension", "BeCustomFilters"); DataTable dt = CustomFilters.GetDataTable(); foreach (DataRow row in dt.Rows) { var f = new JsonCustomFilter { Name = row["Name"].ToString(), FullName = row["FullName"].ToString(), Checked = int.Parse(row["Checked"].ToString()), Spam = int.Parse(row["Cought"].ToString()), Mistakes = int.Parse(row["Reported"].ToString()) }; var ext = ExtensionManager.GetExtension(f.Name); f.Enabled = ext == null ? true : ext.Enabled; filterList.Add(f); } } catch (Exception ex) { Utils.Log("JsonCustomFilterList.GetCustomFilters(): " + ex.Message); } return filterList; }
public void InitSettings() { ExtensionSettings settings = new ExtensionSettings(this); settings.IsScalar = true; settings.AddParameter("PublicKey", "Public Key", 50, true, true, ParameterType.String); settings.AddValue("PublicKey", "YOURPUBLICKEY"); settings.AddParameter("PrivateKey", "Private Key", 50, true, true, ParameterType.String); settings.AddValue("PrivateKey", "YOURPRIVATEKEY"); settings.AddParameter("ShowForAuthenticatedUsers", "Show Captcha For Authenticated Users", 1, true, false, ParameterType.Boolean); settings.AddValue("ShowForAuthenticatedUsers", false); settings.AddParameter("MaxLogEntries", "Logging: Maximum successful recaptcha attempts to store (set to 0 to disable logging)", 4, true, false, ParameterType.Integer); settings.AddValue("MaxLogEntries", 50); settings.AddParameter("Theme", "Theme", 20, true, false, ParameterType.DropDown); settings.AddValue("Theme", new string[] { "red", "white", "blackglass", "clean" }, "white"); settings.Help = "\n<script language='javascript' type='text/javascript'>\n" + JScript + "\n</script>\n" + "You can create your own public key at <a href='http://www.Recaptcha.net'>http://www.Recaptcha.net</a>. This is used for communication between your website and the recapcha server.<br /><br />Please rememeber you need to <span style=\"color:red\">enable extension</span> for reCaptcha to show up on the comments form.<br /><br />You can see some statistics on Captcha solving by storing successful attempts. If you're getting spam, this should also confirm that the spammers are at least solving the captcha.<br /><br /><a href='../Pages/RecaptchaLogViewer.aspx' target='_blank' onclick='return showRecaptchaLog()'>Click here to view the log</a>"; _settings = ExtensionManager.InitSettings("Recaptcha", settings); ExtensionManager.SetStatus("Recaptcha", false); }
/// <summary> /// Constructor /// </summary> /// <param name="name">Extension Name</param> /// <param name="version">Extension Version</param> /// <param name="desc">Description</param> /// <param name="author">Extension Author</param> /// <param name="adminpage">Custom admin page for extension</param> public ManagedExtension(string name, string version, string desc, string author) { _name = name; _version = version; _description = desc; _author = author; _settings = null; }
/// <summary> /// Update the properties of a subscription /// </summary> /// <param name="reportSchedule">report schedule parmater</param> public void UpdateSubscription(ReportSchedule reportSchedule) { reportSchedule.ReportSubscriptionId = db.ReportSchedules.Where(r => r.ReportId == reportSchedule.ReportId).Select(r => r.ReportSubscriptionId).FirstOrDefault(); reportSchedule.Report = db.Reports.Where(r => r.ReportId == reportSchedule.ReportId).FirstOrDefault(); ReportingService2010 rs = new ReportingService2010(); rs.Url = ConfigurationManager.AppSettings[ReportServerURL]; //rs.Credentials = System.Net.CredentialCache.DefaultCredentials; rs.UseDefaultCredentials = true; ActiveState active = null; ExtensionSettings extSettings = null; ParameterValue[] values; string desc = string.Empty; string eventType = string.Empty; string matchData = string.Empty; string status; Subscription[] subscriptions = null; //string subscriptionFileName = String.Concat(/*reportSchedule.Schedule_ID,*/ FileNameSplitter, reportSchedule.Report.ReportName, FileNameSplitter, TimestampParameter); //subscriptions = rs.ListSubscriptions(reportSchedule.Report.ReportPath); ////Get the subscription from the filename //var subscription = subscriptions.ToList().Select(r => { r.DeliverySettings.ParameterValues.Cast<ParameterValue>().Where(d => d.Name == FileName && d.Value == subscriptionFileName); return r; }).FirstOrDefault(); //Get Subscription properties rs.GetSubscriptionProperties(reportSchedule.ReportSubscriptionId, out extSettings, out desc, out active, out status, out eventType, out matchData, out values); //Get the schedule data matchData = new ReportScheduleFormatter().GetMatchData(reportSchedule); //Set the Report Name Descriptions desc = reportSchedule.Report.ReportName; //TODO: Below code is needed because for the password. Giving an error with out the password ParameterValue[] extensionParamsTemp = new ParameterValue[extSettings.ParameterValues.Count() + 1]; //extSettings.ParameterValues.CopyTo(extensionParamsTemp, 0); //extensionParamsTemp[extSettings.ParameterValues.Count()] = new ParameterValue { Name = Password, Value = ConfigurationManager.AppSettings[ReportPassword] }; //extSettings.ParameterValues = extensionParamsTemp; rs.SetSubscriptionProperties(reportSchedule.ReportSubscriptionId, extSettings, desc, eventType, matchData, values); db.Entry(reportSchedule).State = EntityState.Modified; db.SaveChanges(); //Console.WriteLine("Report Succesfully Updated"); }
/// <summary> /// Inits the filters. /// </summary> private static void InitFilters() { var settings = new ExtensionSettings("BeCommentFilters"); settings.AddParameter("ID", "ID", 20, true, true, ParameterType.Integer); settings.AddParameter("Action"); settings.AddParameter("Subject"); settings.AddParameter("Operator"); settings.AddParameter("Filter"); filters = ExtensionManager.InitSettings("MetaExtension", settings); }
public static void SaveSettings(string extensionName, ExtensionSettings settings) { foreach (ManagedExtension x in _extensions) { if (x.Name == extensionName) { x.SaveSettings(settings); break; } } Save(); }
/// <summary> /// Loads the configuration for this section from the plugin own configuration file /// </summary> public void LoadConfiguration() { ListBox workingList = null; PlayMode mode = PlayMode.Unrecognized; XmlDocument doc = new XmlDocument(); string path = Config.GetFile(Config.Dir.Config, "MPlayer_ExtPlayer.xml"); doc.Load(path); if (doc.DocumentElement != null) { XmlNodeList listExtensionFamilies = doc.DocumentElement.SelectNodes("/mplayer/extensions"); if (listExtensionFamilies != null) { foreach (XmlNode nodeFamily in listExtensionFamilies) { if (nodeFamily.Attributes["family"].Value.Equals("Video")) { workingList = videoExtList; mode = PlayMode.Video; } else if (nodeFamily.Attributes["family"].Value.Equals("Audio")) { workingList = audioExtList; mode = PlayMode.Audio; } if (workingList != null) { workingList.Items.Clear(); } XmlNodeList listExtensions = nodeFamily.SelectNodes("Extension"); if (listExtensions != null) { foreach (XmlNode nodeExtension in listExtensions) { ExtensionSettings settings = new ExtensionSettings { Name = nodeExtension.Attributes["name"].Value, Arguments = nodeExtension.Attributes["arguments"].Value, ExtPlayerUse = Boolean.Parse(nodeExtension.Attributes["extPlayerUse"].Value), PlayMode = mode }; if (workingList != null && !workingList.Items.Contains(settings.Name)) { workingList.Items.Add(settings); } } } } } } }
private static ExtensionSettings LoadExtensionSettingsForBlogInstance() { ExtensionSettings initialSettings = new ExtensionSettings(_extensionName); initialSettings.Help = @" <p>Build on <a href=""http://mediaelement.js.com/"">MediaElement.js</a>, the HTML5 video/audio player.</p> <ol> <li>Upload media files to your /media/ folder</li> <li>Add short code to your media: [video src=""myfile.mp4""] for video and [audio src=""myfile.mp3""] for audio</li> <li>Customize with the following parameters: <ul> <li><b>width</b>: The exact width of the video</li> <li><b>height</b>: The exact height of the video</li> <li><b>autoplay</b>: Plays the video as soon as the webpage loads</li> </ul> </li> <li>You can also specify multiple file formats and codecs <ul> <li><b>mp4</b>: H.264 encoded MP4 file</li> <li><b>webm</b>: VP8/WebM encoded file</li> <li><b>ogg</b>: Theora/Vorbis encoded file</li> </ul> </li> </ol> <p>A complete example:<br /> [code mp4=""myfile.mp4"" webm=""myfile.webm"" ogg=""myfile.ogg"" width=""480"" height=""360""] </p> <p>Supported formats</p> <ul> <li><b>MP4/MP3</b>: Native HTML5 for IE9, Safari, Chrome; Flash in IE8, Firefox, Opera</li> <li><b>WebM</b>: HTML5 for IE9, Chrome, Firefox, Opera; Flash in IE8 (coming in Flash 11)</li> <li><b>FLV</b>: Flash fallback</li> <li><b>WMV/WMA</b>: Silverlight fallback</li> </ul> "; initialSettings.IsScalar = true; initialSettings.AddParameter("width", "Default Width"); initialSettings.AddValue("width", _widthDefault.ToString()); initialSettings.AddParameter("height", "Default Height"); initialSettings.AddValue("height", _heightDefault.ToString()); initialSettings.AddParameter("folder", "Folder for Media (MP4, MP3, WMV, Ogg, WebM, etc.)"); initialSettings.AddValue("folder", _folderDefault); return(ExtensionManager.InitSettings(_extensionName, initialSettings)); }
/// <summary> /// Add item /// </summary> /// <param name="item"></param> /// <returns>New item</returns> public CommentFilterItem Add(CommentFilterItem item) { if (!Security.IsAuthorizedTo(Rights.AccessAdminPages)) { throw new UnauthorizedAccessException(); } try { Filters = ExtensionManager.GetSettings("MetaExtension", "BeCommentFilters"); string id = Guid.NewGuid().ToString(); int parLen = Filters.Parameters[0].Values.Count; for (int i = 0; i < parLen; i++) { bool exists = Filters.Parameters[1].Values[i] == item.Action && Filters.Parameters[2].Values[i] == item.Subject && Filters.Parameters[3].Values[i] == item.Operation && Filters.Parameters[4].Values[i] == item.Filter; if (exists) { throw new ApplicationException("Item already exists"); } } string[] f = new string[] { id, item.Action, item.Subject, item.Operation, item.Filter }; Filters.AddValues(f); ExtensionManager.SaveSettings("MetaExtension", Filters); return(new CommentFilterItem { Id = Guid.Parse(id), Action = item.Action, Subject = item.Subject, Operation = item.Operation, Filter = item.Filter }); } catch (Exception ex) { Utils.Log("Error adding new comment filter", ex); throw; } }
private static void InitSettings() { ExtensionSettings initialSettings = new ExtensionSettings(_extensionName); initialSettings.Help = @" <p>Build on <a href=""http://mediaelement.js.com/"">MediaElement.js</a>, the HTML5 video/audio player.</p> <ol> <li>Upload media files to your /media/ folder</li> <li>Add short code to your media: [video src=""myfile.mp4""] for video and [audio src=""myfile.mp3""] for audio</li> <li>Customize with the following parameters: <ul> <li><b>width</b>: The exact width of the video</li> <li><b>height</b>: The exact height of the video</li> <li><b>autoplay</b>: Plays the video as soon as the webpage loads</li> </ul> </li> <li>You can also specify multiple file formats and codecs <ul> <li><b>mp4</b>: H.264 encoded MP4 file</li> <li><b>webm</b>: VP8/WebM encoded file</li> <li><b>ogg</b>: Theora/Vorbis encoded file</li> </ul> </li> </ol> <p>A complete example:<br /> [code mp4=""myfile.mp4"" webm=""myfile.webm"" ogg=""myfile.ogg"" width=""480"" height=""360""] </p> <p>Supported formats</p> <ul> <li><b>MP4/MP3</b>: Native HTML5 for IE9, Safari, Chrome; Flash in IE8, Firefox, Opera</li> <li><b>WebM</b>: HTML5 for IE9, Chrome, Firefox, Opera; Flash in IE8 (coming in Flash 11)</li> <li><b>FLV</b>: Flash fallback</li> <li><b>WMV/WMA</b>: Silverlight fallback</li> </ul> "; initialSettings.IsScalar = true; initialSettings.AddParameter("width", "Default Width"); initialSettings.AddValue("width", _widthDefault.ToString()); initialSettings.AddParameter("height", "Default Height"); initialSettings.AddValue("height", _heightDefault.ToString()); initialSettings.AddParameter("folder", "Folder for Media (MP4, MP3, WMV, Ogg, WebM, etc.)"); initialSettings.AddValue("folder", _folderDefault); _settings = ExtensionManager.InitSettings(_extensionName, initialSettings); }
private void CreateSubscription(FileInfo subscriptionFile, string reportPath) { string[] subscriptionInfoText = File.ReadAllLines(subscriptionFile.FullName); if (SubscriptionInfo(subscriptionInfoText, "subscriptionOn").ToLower() == "true") { var eventType = SubscriptionInfo(subscriptionInfoText, "eventType"); var scheduleXml = SubscriptionInfo(subscriptionInfoText, "scheduleXml"); var subscriptionType = SubscriptionInfo(subscriptionInfoText, "subscriptionType"); var subscriptionTypeParameters = GetSubscriptionTypeParameters(subscriptionInfoText); var extSettings = new ExtensionSettings { ParameterValues = subscriptionTypeParameters, Extension = string.IsNullOrEmpty(subscriptionType) ? "Report Server Email" : "Report Server FileShare" }; ParameterValue[] reportParameterValues = null; string reportParameters = SubscriptionInfo(subscriptionInfoText, "reportParameters"); if (!string.IsNullOrEmpty(reportParameters)) { string[] reportParameterParts = reportParameters.Split(';'); reportParameterValues = new ParameterValue[reportParameterParts.Length]; Log("Found {0} report parameter values to set", reportParameterParts.Length); for (int i = 0; i <= reportParameterParts.Length - 1; i++) { var reportValue = new ParameterValue(); var parameterKeyValues = reportParameterParts[i].Split('='); Log("Setting parameter '{0}', with '{1}'", parameterKeyValues[0], parameterKeyValues[1]); reportValue.Name = parameterKeyValues[0]; reportValue.Value = parameterKeyValues[1]; reportParameterValues[i] = reportValue; } } else { Log("Subscription report parameters not found in '{0}'", subscriptionFile.Name); } Log("Creating subscription '{0}'", subscriptionFile.Name); rs.CreateSubscription(reportPath, extSettings, subscriptionFile.Name + " - Subscription", eventType, scheduleXml, reportParameterValues); Log("Created subscription '{0}'", subscriptionFile.Name); } else { Log("Subscription not set to 'On' for '{0}'", subscriptionFile.Name); } }
public AudioStream() { //Comment.Serving += new EventHandler<ServingEventArgs>(Post_CommentServing); ExtensionSettings settings = new ExtensionSettings("AudioStream"); settings.AddParameter("HighStream", "HighStream.", 500, true, false, ParameterType.String); settings.AddParameter("LowStream", "LowStream.", 500, true, false, ParameterType.String); // settings.AddValue("HighStream", "Http://HighStreamVoorbeeld.nl"); //settings.AddValue("LowStream", "Http://lowstreamVoorbeeld.nl"); settings.IsScalar = true; ExtensionManager.ImportSettings(settings); }
/// <summary> /// Dynamically loads form controls or /// data grid and binds data to controls /// </summary> /// <param name="sender"> /// The source of the event. /// </param> /// <param name="e"> /// The <see cref="System.EventArgs"/> instance containing the event data. /// </param> protected void Page_Load(object sender, EventArgs e) { Security.DemandUserHasRight(BlogEngine.Core.Rights.AccessAdminPages, true); this.SettingName = this.ID; this.Settings = ExtensionManager.GetSettings(this.SettingName); this.GenerateDeleteButton = this.Settings.ShowDelete; this.GenerateEditButton = this.Settings.ShowEdit; if (this.Settings.ShowAdd) { this.CreateFormFields(); } if (!this.Page.IsPostBack) { if (this.Settings.IsScalar) { this.BindScalar(); } else { this.CreateTemplatedGridView(); this.BindGrid(); } } if (this.Settings.IsScalar) { this.btnAdd.Text = labels.save; } else { if (this.Settings.ShowAdd) { this.grid.RowEditing += this.GridRowEditing; this.grid.RowUpdating += this.GridRowUpdating; this.grid.RowCancelingEdit += (o, args) => this.Response.Redirect(this.Request.RawUrl); this.grid.RowDeleting += this.GridRowDeleting; this.btnAdd.Text = labels.add; } else { this.btnAdd.Visible = false; } } this.btnAdd.Click += this.BtnAddClick; }
private void InitSettings() { ExtensionSettings settings = new ExtensionSettings(this); settings.IsScalar = true; settings.AddParameter("SiteURL", "Site URL"); settings.AddParameter("ApiKey", "API Key"); settings.AddValue("SiteURL", "http://example.com/blog"); settings.AddValue("ApiKey", "123456789"); _settings = ExtensionManager.InitSettings("TypePadFilter", settings); ExtensionManager.SetStatus("TypePadFilter", false); }
private static string getToLine(ExtensionSettings es) { ParameterValueOrFieldReference[] paramVals = es.ParameterValues; ParameterValue paramVal; for (int i = 0; i < paramVals.Length; i++) { paramVal = (ParameterValue)paramVals[i]; if (paramVal.Name == "TO") { return paramVal.Value; } } return null; }
protected void InitFeaturedPostsImages() { ExtensionSettings featuredPostsImages = new ExtensionSettings("FeaturedPostsImages"); featuredPostsImages.AddParameter("id", "id", 38, true, true, ParameterType.Integer); featuredPostsImages.AddParameter("PostID", "PostID", 38, true, false, ParameterType.DropDown); featuredPostsImages.AddParameter("PostTitle", "Post Title", 38, true, false, ParameterType.DropDown); featuredPostsImages.AddParameter("Image", "Image"); featuredPostsImages.AddParameter("ImageSize", "Size", 100, false, false, ParameterType.String); ExtensionManager.SetAdminPage("FeaturedPostsRotator", "~/Custom/Controls/FeaturedPostsRotator/Admin.aspx"); ExtensionManager.ImportSettings("FeaturedPostsRotator", featuredPostsImages); _featuredPostsImages = ExtensionManager.GetSettings("FeaturedPostsRotator", "FeaturedPostsImages"); }
/// <summary> /// The init log settings. /// </summary> public void InitLogSettings() { var settings = new ExtensionSettings("RecaptchaLog"); settings.AddParameter("Response"); settings.AddParameter("CommentID"); settings.AddParameter("TimeToComment"); settings.AddParameter("TimeToSolveCapcha"); settings.AddParameter("NumberOfAttempts"); settings.AddParameter("Enabled"); settings.AddParameter("Necessary"); settings.Hidden = true; ExtensionManager.InitSettings("Recaptcha", settings); }
public bool ShowSettings() { SessionSettings editableSettings = new SessionSettings(this.Settings); ExtensionSettings settingsWindow = new ExtensionSettings(); settingsWindow.DataContext = editableSettings; bool?result = settingsWindow.ShowDialog(); if ((result.HasValue) && (result.Value)) { this.Settings.CopyFrom(editableSettings, false); SaveSettings(); return(true); } return(false); }
/// <summary> /// Dynamically loads form controls or /// data grid and binds data to controls /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { _extensionName = ID; _settings = ExtensionManager.GetSettings(_extensionName); GenerateDeleteButton = _settings.ShowDelete; GenerateEditButton = _settings.ShowEdit; if (_settings.ShowAdd) { CreateFormFields(); } if (!Page.IsPostBack) { if (_settings.IsScalar) { BindScalar(); } else { CreateTemplatedGridView(); BindGrid(); } } if (_settings.IsScalar) { btnAdd.Text = Resources.labels.save; } else { if (_settings.ShowAdd) { grid.RowEditing += grid_RowEditing; grid.RowUpdating += grid_RowUpdating; grid.RowCancelingEdit += delegate { Response.Redirect(Request.RawUrl); }; grid.RowDeleting += grid_RowDeleting; btnAdd.Text = Resources.labels.add; } else { btnAdd.Visible = false; } } btnAdd.Click += btnAdd_Click; }
private static ExtensionSettings setExtSettings(string agentRepEmail) { // ExtensionSettings extSettings = new ExtensionSettings(); extSettings.Extension = "Report Server Email"; ParameterValue pv0 = new ParameterValue(); pv0.Name = "TO"; pv0.Value = agentRepEmail; ParameterValue pv1 = new ParameterValue(); pv1.Name = "CC"; pv1.Value = ""; ParameterValue pv2 = new ParameterValue(); pv2.Name = "IncludeReport"; pv2.Value = "True"; ParameterValue pv3 = new ParameterValue(); pv3.Name = "RenderFormat"; pv3.Value = "PDF"; ParameterValue pv4 = new ParameterValue(); pv4.Name = "Subject"; pv4.Value = "@ReportName was executed at @ExecutionTime"; ParameterValue pv5 = new ParameterValue(); pv5.Name = "IncludeLink"; pv5.Value = "False"; ParameterValue pv6 = new ParameterValue(); pv6.Name = "Priority"; pv6.Value = "NORMAL"; extSettings.ParameterValues = new ParameterValueOrFieldReference[] { pv0, pv1, pv2, pv3, pv4, pv5, pv6 }; return(extSettings); }
public static bool ImportSettings(string extensionName, ExtensionSettings settings) { foreach (ManagedExtension x in _extensions) { if (x.Name == extensionName) { if (!x.Initialized(settings)) { x.InitializeSettings(settings); } break; } } SaveToCache(); //return SaveToStorage(); return(true); }
/// <summary> /// Determine if settings has been initialized with default /// values (first time new extension loaded into the manager) /// </summary> /// <param name="settingName">Settings name</param> /// <returns>True if initialized</returns> public bool Initialized(ExtensionSettings xs) { if (xs != null) { foreach (ExtensionSettings setItem in _settings) { if (setItem.Name == xs.Name) { if (setItem.Parameters.Count == xs.Parameters.Count) { return(true); } } } } return(false); }
public FacebookCompartilhar() { BlogEngine.Core.Post.Serving += new EventHandler <ServingEventArgs>(PrepareFacebookCompartilhar); ExtensionSettings settings = new ExtensionSettings(ExtensionName); settings.AddParameter("findImg", "Exibir imagem", 1, true, false, ParameterType.Boolean); settings.AddParameter("ondeExibir", "Onde exibir", 10, true, false, ParameterType.DropDown); settings.AddValue("findImg", true); settings.AddValue("ondeExibir", new string[] { "Topo", "Rodape" }, "Rodapé"); settings.Help = "<br />Botão de compartilhamento do post no facebook.<br /><a target=\"_blank\" href=\"http://www.acainfo.com.br\">ACA INFO</a>"; settings.IsScalar = true; _settings = ExtensionManager.InitSettings(ExtensionName, settings); }
private static void OnPublish(string reportName, DateTime routeDate, string routeClass) { ReportingService2010 rs = new ReportingService2010(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials; //Request all subscriptions for the specified report Subscription[] subscriptions = rs.ListSubscriptions(reportName); if (subscriptions != null) { //Enumerate all subscriptions for (int i = 0; i < subscriptions.Length; i++) { //Get subscription properties Subscription sub = subscriptions[i]; ExtensionSettings extSettings = null; ActiveState active = null; string desc = "", status = "", eventType = "", matchData = ""; ParameterValue[] paramValues = null; rs.GetSubscriptionProperties(sub.SubscriptionID, out extSettings, out desc, out active, out status, out eventType, out matchData, out paramValues); rs.SetSubscriptionProperties(sub.SubscriptionID, extSettings, desc, "SnapshotUpdated", null, paramValues); } //Set report parameters and update the snapshot so that subscriptions will be executed ItemParameter[] itemParams = rs.GetItemParameters(reportName, null, false, null, null); for (int i = 0; i < itemParams.Length; i++) { if (itemParams[i].Name == PARAM_ROUTEDATE) { itemParams[i].DefaultValues = new string[1] { routeDate.ToString("yyyy-MM-dd") } } ; if (itemParams[i].Name == PARAM_ROUTECLASS) { itemParams[i].DefaultValues = new string[1] { routeClass } } ; } rs.SetItemParameters(reportName, itemParams); rs.UpdateItemExecutionSnapshot(reportName); } }
protected void Page_Load(object sender, EventArgs e) { WebUtils.CheckRightsForAdminSettingsPage(false); Filters = ExtensionManager.GetSettings("MetaExtension", "BeCommentFilters"); if (!IsPostBack) { BindFilters(); } Page.MaintainScrollPositionOnPostBack = true; Page.Title = Resources.labels.comments; btnSave.Click += btnSave_Click; btnSave.Text = Resources.labels.saveSettings; }
protected override void OnExecute() { VCProjectWrapper project = SolutionHelper.GetProjectOfSelection(Package); FolderBrowserDialog dlg = new FolderBrowserDialog(); dlg.SelectedPath = project.GetProjectDirectory(); dlg.ShowNewFolderButton = false; if (dlg.ShowDialog() == DialogResult.OK) { ExtensionSettings settings = SettingsManager.GetSettings(project); string projectDir = project.GetProjectDirectory(); settings.RelativeProjectRoot = PathHelper.GetRelativePath(projectDir, dlg.SelectedPath + Path.DirectorySeparatorChar); SettingsManager.SaveSettings(project); } }
protected void InitSettings() { ExtensionSettings settings = new ExtensionSettings("FeaturedPostsRotator"); settings.AddParameter("UseExtensionJQuery", "Use Extension JQuery file", 1, true, false, ParameterType.Boolean); settings.AddValue("UseExtensionJQuery", true); settings.IsScalar = true; // set page that extension manager will use // instead of default settings page ExtensionManager.SetAdminPage("FeaturedPostsRotator", "~/Custom/Controls/FeaturedPostsRotator/Admin.aspx"); ExtensionManager.ImportSettings(settings); _settings = ExtensionManager.GetSettings("FeaturedPostsRotator"); }
/// <summary> /// Method to cache and serialize settings object /// </summary> /// <param name="settings">Settings object</param> public void SaveSettings(ExtensionSettings settings) { if (string.IsNullOrEmpty(settings.Name)) { settings.Name = _name; } foreach (ExtensionSettings setItem in _settings) { if (setItem.Name == settings.Name) { _settings.Remove(setItem); break; } } _settings.Add(settings); }
/// <summary> /// The init settings. /// </summary> public void InitSettings() { var settings = new ExtensionSettings(this) { IsScalar = true }; settings.AddParameter("PublicKey", "Public Key", 50, true, true, ParameterType.String); settings.AddValue("PublicKey", "YOURPUBLICKEY"); settings.AddParameter("PrivateKey", "Private Key", 50, true, true, ParameterType.String); settings.AddValue("PrivateKey", "YOURPRIVATEKEY"); settings.AddParameter( "ShowForAuthenticatedUsers", "Show Captcha For Authenticated Users", 1, true, false, ParameterType.Boolean); settings.AddValue("ShowForAuthenticatedUsers", false); settings.AddParameter( "MaxLogEntries", "Logging: Maximum successful recaptcha attempts to store (set to 0 to disable logging)", 4, true, false, ParameterType.Integer); settings.AddValue("MaxLogEntries", 50); settings.AddParameter("Theme", "Theme", 20, true, false, ParameterType.DropDown); settings.AddValue("Theme", new[] { "red", "white", "blackglass", "clean" }, "white"); settings.AddParameter("Language", "Language", 5, true, false, ParameterType.DropDown); settings.AddValue("Language", new[] { "en|English", "nl|Dutch", "fr|French", "de|German", "pt|Portuguese", "ru|Russian", "es|Spanish", "tr|Turkish" }, "en"); settings.Help = string.Format( "\n<script type='text/javascript'>\n{0}\n</script>\nYou can create your own public key at <a href='http://www.Recaptcha.net'>http://www.Recaptcha.net</a>. This is used for communication between your website and the recapcha server.<br /><br />Please rememeber you need to <span style=\"color:red\">enable extension</span> for reCaptcha to show up on the comments form.<br /><br />You can see some statistics on Captcha solving by storing successful attempts. If you're getting spam, this should also confirm that the spammers are at least solving the captcha.<br /><br /><a href='../Pages/RecaptchaLogViewer.aspx' target='_blank' onclick='return showRecaptchaLog()'>Click here to view the log</a>", this.JScript); Settings = ExtensionManager.InitSettings("Recaptcha", settings); ExtensionManager.SetStatus("Recaptcha", false); }
private void InitializeSettings() { var settings = new ExtensionSettings(ExtensionName); settings.Help = "Enable facebook Like button on Post Home page and Post page"; settings.IsScalar = true; settings.AddParameter("ShowPostList", "Display Like button on featured list", 20, false, false, ParameterType.Boolean); settings.AddParameter("ShowFaces", "Show Faces (Show profile pictures below the button)", 20, false, false, ParameterType.Boolean); settings.AddParameter("Width", "Width (the width of the plugin in pixel)", 20, false, false, ParameterType.String); settings.AddParameter("Action", "Verb to display", 20, false, false, ParameterType.DropDown); settings.AddValue("Action", new string [] { "like", "recommend" }, "like"); settings.AddParameter("ColorScheme", "Color Scheme (color scheme of the plugin)", 20, false, false, ParameterType.DropDown); settings.AddValue("ColorScheme", new string[] { "light", "dark" }, "light"); settings.AddParameter("SelectedLayout", "Layout Style", 20, false, false, ParameterType.DropDown); settings.AddValue("SelectedLayout", new string[] { "standard", "button_count", "box_count" }, "standard"); settings.AddValue("ShowPostList", true); _extensionSettings = ExtensionManager.InitSettings(ExtensionName, settings); }
static void InitCustomFilters() { ExtensionSettings settings = new ExtensionSettings("BeCustomFilters"); settings.AddParameter("FullName", "Name", 100, true, true); settings.AddParameter("Name"); settings.AddParameter("Checked"); settings.AddParameter("Cought"); settings.AddParameter("Reported"); settings.AddParameter("Priority"); _customFilters = ExtensionManager.InitSettings("MetaExtension", settings); if (_customFilters != null) { DataTable dt = _customFilters.GetDataTable(); ArrayList codeAssemblies = Utils.CodeAssemblies(); foreach (Assembly a in codeAssemblies) { Type[] types = a.GetTypes(); foreach (Type type in types) { if (type.GetInterface("BlogEngine.Core.ICustomFilter") != null) { bool found = false; foreach (DataRow row in dt.Rows) { if (row[0].ToString() == type.Name) { found = true; break; } } if (!found) { _customFilters.AddValues(new string[] { type.FullName, type.Name, "0", "0", "0", "0" }); } } } } ExtensionManager.SaveSettings("MetaExtension", _customFilters); } }
public IEnumerable <SelectOption> Get() { try { var feeds = new List <SelectOption>(); var feedSets = ExtensionManager.GetSettings(_metaExtension, _galleryFeeds); var feedService = "http://dnbe.net/v01/nuget"; if (!string.IsNullOrEmpty(BlogSettings.Instance.GalleryFeedUrl)) { feedService = BlogSettings.Instance.GalleryFeedUrl; } if (feedSets == null) { var settings = new ExtensionSettings(_galleryFeeds); settings.AddParameter("OptionName", "Title", 150, true, true); settings.AddParameter("OptionValue"); settings.AddValues(new[] { "dnbe.net", feedService }); feedSets = ExtensionManager.InitSettings(_metaExtension, settings); ExtensionManager.SaveSettings(_metaExtension, feedSets); } var table = feedSets.GetDataTable(); foreach (DataRow row in table.Rows) { feeds.Add(new SelectOption { OptionName = row[0].ToString(), OptionValue = row[1].ToString() }); } return(feeds); } catch (UnauthorizedAccessException) { throw new HttpResponseException(HttpStatusCode.Unauthorized); } catch (Exception) { throw new HttpResponseException(HttpStatusCode.InternalServerError); } }
/// <summary> /// Loads the configuration for this section from the plugin own configuration file /// </summary> public void LoadConfiguration() { ListBox workingList = null; PlayMode mode = PlayMode.Unrecognized; XmlDocument doc = new XmlDocument(); string path = Config.GetFile(Config.Dir.Config, "MPlayer_ExtPlayer.xml"); doc.Load(path); if (doc.DocumentElement != null) { XmlNodeList listExtensionFamilies = doc.DocumentElement.SelectNodes("/mplayer/extensions"); if (listExtensionFamilies != null) foreach (XmlNode nodeFamily in listExtensionFamilies) { if (nodeFamily.Attributes["family"].Value.Equals("Video")) { workingList = videoExtList; mode = PlayMode.Video; } else if (nodeFamily.Attributes["family"].Value.Equals("Audio")) { workingList = audioExtList; mode = PlayMode.Audio; } if (workingList != null) workingList.Items.Clear(); XmlNodeList listExtensions = nodeFamily.SelectNodes("Extension"); if (listExtensions != null) foreach (XmlNode nodeExtension in listExtensions) { ExtensionSettings settings = new ExtensionSettings { Name = nodeExtension.Attributes["name"].Value, Arguments = nodeExtension.Attributes["arguments"].Value, ExtPlayerUse = Boolean.Parse(nodeExtension.Attributes["extPlayerUse"].Value), PlayMode = mode }; if (workingList != null && !workingList.Items.Contains(settings.Name)) { workingList.Items.Add(settings); } } } } }
protected void Page_Load(object sender, EventArgs e) { // load settings Settings = ExtensionManager.GetSettings("Picasa2"); if (!Page.IsPostBack) { BindForm(); try { litContent.Text = GetAlbumsTable(); } catch (Exception pEx) { litContent.Text = "Error connecting to Picasa: " + pEx.Message; } } }
public Bovenhoek() { //Comment.Serving += new EventHandler<ServingEventArgs>(Post_CommentServing); ExtensionSettings settings = new ExtensionSettings("Bovenhoek"); /* TxtUrl.Text = Settings.GetSingleValue("PeelUrl"); TxtImageUrl.Text = Settings.GetSingleValue("PeelImage"); TxtTarget.Text = Settings.GetSingleValue("PeelTarget");*/ settings.AddParameter("PeelUrl", "PeelUrl.", 500, true, false, ParameterType.String); settings.AddParameter("PeelImage", "PeelImage.", 500, true, false, ParameterType.String); settings.AddParameter("PeelTarget", "PeelTarget.", 500, true, false, ParameterType.String); // settings.AddValue("HighStream", "Http://HighStreamVoorbeeld.nl"); //settings.AddValue("LowStream", "Http://lowstreamVoorbeeld.nl"); settings.IsScalar = true; ExtensionManager.ImportSettings(settings); }
private string getSubjectLine(ExtensionSettings extSettings) { // string subjectLine = ""; ParameterValueOrFieldReference[] extensionParams = extSettings.ParameterValues; if (extensionParams != null) { foreach (ParameterValueOrFieldReference extensionParam in extensionParams) { if (((ParameterValue)extensionParam).Name.ToLower() == "subject") { subjectLine = ((ParameterValue)extensionParam).Value; break; } } } return(subjectLine); }
private static void InitializeSettings() { var settings = new ExtensionSettings(ExtensionName); settings.Help = @"<p>Adds an heyos advertisement in your posts where the [heyos] keyword is found in the body</p> <p>Place the [heyos] keyword on a line by itself in your blog. BlogEngine will automatically wrap the line with paragraph tags which will be replaced with your Heys code.</p> <ol> <li><b>User</b>: Enter the entire string for heyos_ad_user</li> <li><b>type</b>: Enter the entire string for heyos_ad_type</li> <li><b>format</b>: Enter the entire string for heyos_ad_format</li> <li><b>border</b>: Enter the entire string for heyos_color_border</li> <li><b>bg</b>: Enter the entire string for heyos_color_bg</li> <li><b>link</b>: Enter the entire string for heyos_color_link</li> <li><b>text</b>: Enter the entire string for heyos_color_text</li> <li><b>url</b>: Enter the entire string for heyos_color_url</li> </ol> <p> <a href='http://www.Informarea.it'>By Fabrizio Cannatelli</a> </p>"; settings.IsScalar = true; settings.AddParameter("user", "user"); settings.AddValue("user", string.Empty); settings.AddParameter("type", "type"); settings.AddValue("type", string.Empty); settings.AddParameter("format", "format"); settings.AddValue("format", string.Empty); settings.AddParameter("border", "border"); settings.AddValue("border", string.Empty); settings.AddParameter("bg", "bg"); settings.AddValue("bg", string.Empty); settings.AddParameter("link", "link"); settings.AddValue("link", string.Empty); settings.AddParameter("text", "text"); settings.AddValue("text", string.Empty); settings.AddParameter("url", "url"); settings.AddValue("url", string.Empty); _extensionSettings = ExtensionManager.InitSettings(ExtensionName, settings); }
public GoogleAsyncAnalytics() { BlogEngine.Core.Post.Serving += new EventHandler<ServingEventArgs>(PrepareGoogleAnalytics); BlogEngine.Core.Page.Serving += new EventHandler<ServingEventArgs>(PrepareGoogleAnalytics); ExtensionSettings settings = new ExtensionSettings(ExtensionName); settings.AddParameter("trackerID", "Google Tracking Code", 20, true); settings.AddParameter("isAsync", "Use new asynchronous script"); settings.AddParameter("disableForLoggedInUsers", "Disable when users are logged in"); // Load generic default value to illustrate the format settings.AddValue("trackerID", "UA-XXXXXXX-Y"); settings.AddValue("isAsync", true); settings.AddValue("disableForLoggedInUsers", false); settings.Help = "<br />Add Google Analytics to your website.<br />Generate a code for your site by going to https://www.google.com/analytics.<br /><br />The script will get generated at the top of the page, it is recommended that you use the asynchronous script, if you experience problems switch to the synchronous version. Using the synchronous script may delay start-up time for each page as it waits for a response from Google.<br /><br />Disable tracking for logged on users if only admins are logging in and updating posts and/or comments. This allows for more accurate tracking of real site usage."; settings.IsScalar = true; _settings = ExtensionManager.InitSettings(ExtensionName, settings); }
static BBCode() { Comment.Serving += new EventHandler <ServingEventArgs>(Post_CommentServing); // create settings object. You need to pass exactly your // extension class name (case sencitive) ExtensionSettings settings = new ExtensionSettings("BBCode"); //----------------------------------------------------- // 1. Simple //----------------------------------------------------- //settings.AddParameter("Code"); //settings.AddParameter("OpenTag"); //settings.AddParameter("CloseTag"); //----------------------------------------------------- // 2. Some more options //----------------------------------------------------- //settings.AddParameter("Code"); //settings.AddParameter("OpenTag", "Open Tag"); //settings.AddParameter("CloseTag", "Close Tag"); //// describe specific rules applied to entering parameters. overrides default wording. //settings.Help = "Converts BBCode to XHTML in the comments. Close tag is optional."; //----------------------------------------------------- // 3. More options including import defaults //----------------------------------------------------- settings.AddParameter("Code", "Code", 20, true); settings.AddParameter("OpenTag", "Open Tag", 150, true); settings.AddParameter("CloseTag", "Close Tag"); // describe specific rules for entering parameters settings.Help = "Converts BBCode to XHTML in the comments. Close tag is optional."; settings.AddValues(new string[] { "b", "strong", "" }); settings.AddValues(new string[] { "i", "em", "" }); settings.AddValues(new string[] { "u", "span style=\"text-decoration:underline\"", "span" }); settings.AddValues(new string[] { "quote", "cite title=\"Quote\"", "cite" }); //------------------------------------------------------ ExtensionManager.ImportSettings(settings); _settings = ExtensionManager.GetSettings("BBCode"); }
static BBCode() { Comment.Serving += new EventHandler<ServingEventArgs>(Post_CommentServing); // create settings object. You need to pass exactly your // extension class name (case sencitive) ExtensionSettings settings = new ExtensionSettings("BBCode"); //----------------------------------------------------- // 1. Simple //----------------------------------------------------- //settings.AddParameter("Code"); //settings.AddParameter("OpenTag"); //settings.AddParameter("CloseTag"); //----------------------------------------------------- // 2. Some more options //----------------------------------------------------- //settings.AddParameter("Code"); //settings.AddParameter("OpenTag", "Open Tag"); //settings.AddParameter("CloseTag", "Close Tag"); //// describe specific rules applied to entering parameters. overrides default wording. //settings.Help = "Converts BBCode to XHTML in the comments. Close tag is optional."; //----------------------------------------------------- // 3. More options including import defaults //----------------------------------------------------- settings.AddParameter("Code", "Code", 20, true); settings.AddParameter("OpenTag", "Open Tag", 150, true); settings.AddParameter("CloseTag", "Close Tag"); // describe specific rules for entering parameters settings.Help = "Converts BBCode to XHTML in the comments. Close tag is optional."; settings.AddValues(new string[] { "b", "strong", "" }); settings.AddValues(new string[] { "i", "em", "" }); settings.AddValues(new string[] { "u", "span style=\"text-decoration:underline\"", "span" }); settings.AddValues(new string[] { "quote", "cite title=\"Quote\"", "cite" }); //------------------------------------------------------ ExtensionManager.ImportSettings(settings); _settings = ExtensionManager.GetSettings("BBCode"); }
protected void Page_Load(object sender, EventArgs e) { _filters = ExtensionManager.GetSettings("MetaExtension", "BeCommentFilters"); _customFilters = ExtensionManager.GetSettings("MetaExtension", "BeCustomFilters"); if (!IsPostBack) { BindSettings(); BindFilters(); BindCustomFilters(); string js = "<script type='text/javascript'>ToggleEnableComments();</script>"; ClientScript.RegisterStartupScript(GetType(), "ClientScript1", js); } Page.MaintainScrollPositionOnPostBack = true; Page.Title = Resources.labels.comments; btnSave.Click += btnSave_Click; btnSave.Text = Resources.labels.saveSettings; }
public Sponsor() { //Comment.Serving += new EventHandler<ServingEventArgs>(Post_CommentServing); var settings = new ExtensionSettings("Sponsor"); settings.AddParameter("ID", labels.ID, 150, true, true, ParameterType.String); settings.AddParameter("Name", labels.name, 150, true, false, ParameterType.String); settings.AddParameter("URL", labels.website, 255); //SponsorType Can have values from the SponsorType Enum. The number wil be saved settings.AddParameter("SponsorPage_SponsorType", labels.sponsorType); #region Type Bools //Player Bools settings.AddParameter("Player_Switch", labels.Switch); settings.AddParameter("Player_Solid", labels.Solid); //Widget settings.AddParameter("Widget_Switch", labels.widget); //Mobiele app settings.AddParameter("Mobile_Switch", labels.Switch); settings.AddParameter("Mobile_Solid", labels.Solid); #endregion settings.AddParameter("Mobile_Frequency", labels.Frequency); settings.AddParameter("Logo", labels.sponsorlogo, 255); settings.AddParameter("Description", labels.description, int.MaxValue); settings.AddParameter("CreationDate", labels.setPublishDate); settings.AddParameter("EndDate", labels.endDate); settings.AddParameter("Active", labels.active); ExtensionManager.ImportSettings(settings); }
public CopyCodeToClipboard() { Post.Serving += new EventHandler<ServingEventArgs>(Post_PostServing); Post.Saving += new EventHandler<SavedEventArgs>(Post_Saving); ExtensionSettings initialSettings = new ExtensionSettings(GetType().Name); initialSettings.Help = "This extension is written to work with the <a href=\"http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html\">Code Snippet Plugin for Windows Live Writer</a> and will not work with other syntax highlighting tools."; initialSettings.AddParameter( "copyText", "Text for 'Copy to Clipboard' button?", 255, true ); initialSettings.AddValue( "copyText", "Copy To Clipboard" ); initialSettings.AddParameter( "popupText", "Text for 'View in Popup Window' button?", 255, true ); initialSettings.AddValue( "popupText", "View Plain" ); initialSettings.AddParameter("aboveBelow", "Display above or below code?", 5, true); initialSettings.AddValue("aboveBelow", "Below"); initialSettings.AddParameter( "style", "Any additional styling?", int.MaxValue, false ); initialSettings.AddValue( "style", "" ); initialSettings.AddParameter( "flashFile", "Path to '_clipboard.swf' Flash file?", 255, true ); initialSettings.AddValue( "flashFile", "~/_clipboard.swf" ); initialSettings.IsScalar = true; ExtensionManager.ImportSettings(initialSettings); settings = ExtensionManager.GetSettings(GetType().Name); }
/// <remarks/> public void CreateSubscriptionAsync(string Report, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters, object userState) { if ((this.CreateSubscriptionOperationCompleted == null)) { this.CreateSubscriptionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSubscriptionOperationCompleted); } this.InvokeAsync("CreateSubscription", new object[] { Report, ExtensionSettings, Description, EventType, MatchData, Parameters}, this.CreateSubscriptionOperationCompleted, userState); }
public void InitializeSettings(ExtensionSettings settings) { settings.Index = _settings.Count; SaveSettings(settings); }
/// <summary> /// Method to cache and serialize settings object /// </summary> /// <param name="settings">Settings object</param> public void SaveSettings(ExtensionSettings settings) { if (string.IsNullOrEmpty(settings.Name)) settings.Name = _name; foreach (ExtensionSettings setItem in _settings) { if (setItem.Name == settings.Name) { _settings.Remove(setItem); break; } } _settings.Add(settings); }
/// <remarks/> public string EndGetSubscriptionProperties(System.IAsyncResult asyncResult, out ExtensionSettings ExtensionSettings, out string Description, out ActiveState Active, out string Status, out string EventType, out string MatchData, out ParameterValue[] Parameters) { object[] results = this.EndInvoke(asyncResult); ExtensionSettings = ((ExtensionSettings)(results[1])); Description = ((string)(results[2])); Active = ((ActiveState)(results[3])); Status = ((string)(results[4])); EventType = ((string)(results[5])); MatchData = ((string)(results[6])); Parameters = ((ParameterValue[])(results[7])); return ((string)(results[0])); }
/// <remarks/> public void CreateSubscriptionAsync(string Report, ExtensionSettings ExtensionSettings, string Description, string EventType, string MatchData, ParameterValue[] Parameters) { this.CreateSubscriptionAsync(Report, ExtensionSettings, Description, EventType, MatchData, Parameters, null); }
private void InitSettings() { ExtensionSettings settings = new ExtensionSettings(this); settings.IsScalar = true; settings.AddParameter("SiteURL", "Site URL"); settings.AddParameter("ApiKey", "API Key"); settings.AddValue("SiteURL", "http://example.com/blog"); settings.AddValue("ApiKey", "123456789"); _settings = ExtensionManager.InitSettings("TypePadFilter", settings); ExtensionManager.SetStatus("TypePadFilter", false); }
public string GetSubscriptionProperties(string SubscriptionID, out ExtensionSettings ExtensionSettings, out string Description, out ActiveState Active, out string Status, out string EventType, out string MatchData, out ParameterValue[] Parameters) { object[] results = this.Invoke("GetSubscriptionProperties", new object[] { SubscriptionID}); ExtensionSettings = ((ExtensionSettings)(results[1])); Description = ((string)(results[2])); Active = ((ActiveState)(results[3])); Status = ((string)(results[4])); EventType = ((string)(results[5])); MatchData = ((string)(results[6])); Parameters = ((ParameterValue[])(results[7])); return ((string)(results[0])); }
private static ExtensionSettings setNewEmail(string newEmail, ExtensionSettings es) { ParameterValueOrFieldReference[] paramVals = es.ParameterValues; ParameterValue paramVal; for (int i = 0; i < paramVals.Length; i++) { paramVal = (ParameterValue)paramVals[i]; if (paramVal.Name == "TO") { paramVal.Value = newEmail; paramVals[i] = paramVal; } } es.ParameterValues = paramVals; return es; }
/// <summary> /// Determine if settings has been initialized with default /// values (first time new extension loaded into the manager) /// </summary> /// <param name="settingName">Settings name</param> /// <returns>True if initialized</returns> public bool Initialized(ExtensionSettings xs) { if (xs != null) { foreach (ExtensionSettings setItem in _settings) { if (setItem.Name == xs.Name) { if (setItem.Parameters.Count == xs.Parameters.Count) { return true; } } } } return false; }
/// <summary> /// Do initial import here. /// If already imported, let extension manager take care of settings /// To reset, blogger has to delete all settings in the manager /// </summary> public static bool ImportSettings(ExtensionSettings settings) { foreach (ManagedExtension x in _extensions) { if (x.Name == settings.ExtensionName) { if (x.Settings == null) { x.SaveSettings(settings); } break; } } SaveToCache(); return SaveToXML(); }
/// <summary> /// Will save settings (add to extension object, then /// cache and serialize all object hierarhy to XML) /// </summary> /// <param name="extensionName">Extension Name</param> /// <param name="settings">Settings object</param> public static void SaveSettings(string extensionName, ExtensionSettings settings) { foreach (ManagedExtension x in _extensions) { if (x.Name == extensionName) { x.Settings = settings; break; } } Save(); }
/// <summary> /// Will save settings (add to extension object, then /// cache and serialize all object hierarhy to XML) /// </summary> /// <param name="extensionName">Extension Name</param> /// <param name="settings">Settings object</param> public static void SaveSettings(ExtensionSettings settings) { SaveSettings(settings.Name, settings); }
/// <summary> /// Initializes settings by importing default parameters /// </summary> /// <param name="extensionName">Extension Name</param> /// <param name="settings">Settings object</param> /// <returns>Settings object</returns> public static ExtensionSettings InitSettings(string extensionName, ExtensionSettings settings) { ImportSettings(extensionName, settings); return GetSettings(extensionName, settings.Name); }
public static bool ImportSettings(string extensionName, ExtensionSettings settings) { foreach (ManagedExtension x in _extensions) { if (x.Name == extensionName) { if (!x.Initialized(settings.Name)) x.InitializeSettings(settings); break; } } SaveToCache(); //return SaveToStorage(); return true; }
/// <summary> /// Do initial import here. /// If already imported, let extension manager take care of settings /// To reset, blogger has to delete all settings in the manager /// </summary> public static bool ImportSettings(ExtensionSettings settings) { return ImportSettings(settings.Name, settings); }
// Warning, this method has the side effect of setting description private static ExtensionSettings swapEmailAddresses(ExtensionSettings es, Dictionary<string, string> emailAddressMap, ref string description) { string currentEmail = getToLine(es); string newEmail = findNewEmail(currentEmail, emailAddressMap); description = "Send e-mail to " + newEmail; es = setNewEmail(newEmail, es); return es; }